АШ
Size: a a a
АШ
NK
i
JD
A
require('dotenv').config({path: '.env'});
const Telegraf = require('telegraf');
const Telegram = require('telegraf/telegram');
const bot = new Telegraf(process.env.BOT_TOKEN);
const telegram = new Telegram(process.env.BOT_TOKEN);
bot.use(Telegraf.log());
/**
* Command: /start
*/
bot.start(async (ctx) => {
return ctx.reply('👋');
});
/**
* Просто пишем в чат слово 'бросить'
*/
bot.hears('бросить', async ctx => {
const resultGame = await telegram.sendDice(ctx.message.chat.id);
return ctx.reply('Выпала цифра: ' + resultGame.dice.value);
});
bot.launch();
JD
require('dotenv').config({path: '.env'});
const Telegraf = require('telegraf');
const Telegram = require('telegraf/telegram');
const bot = new Telegraf(process.env.BOT_TOKEN);
const telegram = new Telegram(process.env.BOT_TOKEN);
bot.use(Telegraf.log());
/**
* Command: /start
*/
bot.start(async (ctx) => {
return ctx.reply('👋');
});
/**
* Просто пишем в чат слово 'бросить'
*/
bot.hears('бросить', async ctx => {
const resultGame = await telegram.sendDice(ctx.message.chat.id);
return ctx.reply('Выпала цифра: ' + resultGame.dice.value);
});
bot.launch();
const telegram = bot.telegram
A
const telegram = bot.telegram
JD
bot.hears('бросить', ({ replyWithDice, reply }) => replyWithDice().then(({ dice }) => reply(`Выпала цифра: ${dice.value}`))
ДР
i
j
j
j
OO
OO
I
I