One handler for different events

import { IContext } from 'degreet-telegram/src/types'

bot.listen(
  ['Hello, world', 'Hello!'],
  async (ctx: IContext): Promise<void> => {
    try {
      await ctx.answer.send(ctx.msg.text)
    } catch (e: any) {
      console.error(e)
    }
  }
)

You can also use it for bot.on and bot.command

Last updated