Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Telegraf = require('telegraf')
  2.  
  3. const bot = new Telegraf(process.env.BOT_TOKEN)
  4. bot.use((ctx, next) => {
  5.   const start = new Date()
  6.   return next(ctx).then(() => {
  7.     const ms = new Date() - start
  8.     console.log('Response time %sms', ms)
  9.   })
  10. })
  11. bot.start((ctx) => ctx.reply('Welcome!'))
  12. bot.help((ctx) => ctx.reply('Send me a sticker'))
  13. bot.on('sticker', (ctx) => ctx.reply('👍'))
  14. bot.hears('hi', (ctx) => ctx.reply('Hey there'))
  15. bot.launch()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement