Listening to location

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

bot.on('location', async (ctx: IContext): Promise<void> => {
  try {
    await ctx.answer.send(ctx.location) // { longitude: number, latitude: number }
  } catch (e: any) {
    console.error(e)
  }
})

Last updated