🤖
DegreetTelegram
  • About DegreetTelegram
  • Getting started
  • Bot example
  • Change logs
  • Handle Updates
    • Handling commands
    • Handling text messages
    • Listening to text
    • Listening to location
    • Listening to contact
    • Listening to media & download
    • Listening to edit messages
    • Listening to other updates
    • Listen to entities: links, email, phone number
  • Basics
    • Context
    • Middlewares
    • RegExp in events
    • One handler for different events
    • Keyboard
    • Options
  • Modularity
    • Blocks of code
    • Layouts (e.g. Menu)
    • Block Scene
    • Step Scene
  • Additional
    • Session, Props, Custom Context
    • Check Subscription
    • Edit and Delete messages
    • Toasts and Alerts
    • Send Media
    • Edit Media
    • Send Dice
    • Kick Chat Member
    • I18n: multilanguage
    • On chat member update, allowed updates
    • Pin & unpin messages
  • Advanced
    • Payments
    • Webhook
    • Copy, Forward message
Powered by GitBook
On this page
  1. Handle Updates

Listening to edit messages

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

bot.on('edit', async (ctx: IContext): Promise<void> => {
  try {
    await ctx.answer.send(ctx.msg)
  } catch (e: any) {
    console.error(e)
  }
})
bot.on('edit', async (ctx) => {
  try {
    await ctx.answer.send(ctx.msg)
  } catch (e) {
    console.error(e)
  }
})
PreviousListening to media & downloadNextListening to other updates

Last updated 3 years ago