17 lines
428 B
TypeScript
17 lines
428 B
TypeScript
import { Bot } from 'grammy';
|
|
|
|
import { cmdStart, cmdHelp } from './src/commands';
|
|
import { menu } from './src/menu';
|
|
|
|
const bot = new Bot(process.env.TOKEN);
|
|
bot.use(menu);
|
|
|
|
bot.command('start', cmdStart);
|
|
bot.command('help', cmdHelp);
|
|
bot.command('menu', async (ctx) => {
|
|
await ctx.reply('🛣️ Навигация', { reply_markup: menu });
|
|
});
|
|
bot.on('message', (ctx) => ctx.reply('Got another message!'));
|
|
|
|
bot.start();
|