nickolay.laptev
nickolay.laptev

Reputation: 2565

Detect stopping of Telegram bot

Does Telegram bot receive any message when the user stops the bot?

When the user starts communication with a bot, he/she sends "/start" command/message to the bot. I would like to know when the user decided to leave.

Upvotes: 1

Views: 1144

Answers (1)

Sumit Jaiswal
Sumit Jaiswal

Reputation: 236

If you are using InlineKeyboardMarkup I would suggest to use timeout parameter in MessageLoop, so you would know when the user stops sending callback queries.

Something like this

ERROR:root:on_close() called due to IdleTerminate: 1 #1 sec termination

Otherwise there is no method to know that the user has stopped interacting with the bot.

Upvotes: 1

Related Questions