1.0.3 • Published 6 years ago
@jace1995/telegraf v1.0.3
TypeScript wrapper over telegraf
Install
npm i -S @jace1995/telegraf
Usage
import {Telegraf} from '@jace1995/telegraf';
const bot = new Telegraf('<TOKEN>');
bot.command('start', (ctx) => {
console.log('started: ', ctx.chat.id);
ctx.reply('Welcome!');
});
bot.command('help', (ctx) => ctx.reply('Try send a sticker!'));
bot.hears('hi', (ctx) => ctx.reply('Hey there!'));
bot.hears(/buy/i, (ctx) => ctx.reply('Buy-buy!'));
bot.on('sticker', (ctx) => ctx.reply('👍'));
bot.startPolling();