Issue
I am using Java library for Telegram Bots Api: https://github.com/rubenlagus/TelegramBots
The thing I'm wondering about — is it possible to detect when bot is removed from user contact list?
I would like to handle this event to delete user settings (such as language) from database, so next time user adds my bot, he can specify settings from scratch and not stucking on selected previously.
SOLUTION FOUND
I described my solution below.
Solution
Ok, I think I have found a possible solution.
Hope, it will help to somebody.
There's no need to handle bot removing, instead of this you can handle bot's restart, because first message bot receives everytime after user clears history or re-adds removed bot — is /start command. So receiveing /start command is a good point to reset previous settings and let user to specify them again.
Also see the discussion above: Telegram Bot — reset user settings on chat removing / clearing
Answered By - konata
Answer Checked By - Marilyn (JavaFixing Volunteer)