Listening to text

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

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

Last updated