Search code examples
javascripttelegramtelegraf.js

Telegram Bot: detect when user read message


I am working on a telegram bot using telegraf JS. My bot periodically sends messages to my users. I would like to know when a user read a message my bot sent (on telegram app, there is small v on the bottom right corner of a message when I read the message).

Is there a way for my bot to detect this event ?

I did check Telegraf JS documentation but I did not find.

I use typescript, so I checked the function bot.on that takes a filter as first argument and a callback at second argument, for instance to capture user's message:

telegraf.on('text', (ctx) => console.log('Got a message !'));

I found possible filters (in telegram-types.d.ts):

export type UpdateType =
  'callback_query' |
  'channel_post' |
  'chosen_inline_result' |
  'edited_channel_post' |
  'edited_message' |
  'inline_query' |
  'message' |
  'pre_checkout_query' |
  'shipping_query' |
  'poll' |
  'poll_answer'

export type MessageSubTypes =
  'voice' |
  'video_note' |
  ...

Maybe there is one filter that corresponds to what I am trying to do but I don't find a documentation that explains what all this types correspond...

I did search for doc on this types here:


Solution

  • unfortunately, telegram bot api don't have this function