Pin & unpin messages

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

bot.command('start', async (ctx: IContext): Promise<any> => {
  try {
    const msg: IMessage = await ctx.answer.send('Hello!')
    await ctx.answer.pin(msg.message_id)
    await ctx.answer.unpin(msg.message_id)
  } catch (e: any) {
    console.error(e)
  }
})

Last updated