Answer the question
In order to leave comments, you need to log in
How to delete an entry from the database when deleting a message in a telegram bot?
I am making a telegram bot in python that writes to the database. Please tell me how to make it so that when deleting a message in a chat with a bot, the entry in the database is deleted? Communication is conducted directly with the bot.
Answer the question
In order to leave comments, you need to log in
If the message is deleted by the client, then most likely nothing, although I can suggest checking the message using the message_id filter, if the id is missing, then delete the entry from the database, but I'm not sure that after deleting the message by the client, the telegram deletes the message itself from the server, However, I think it's worth checking out.
In case you delete a message by a bot, then everything should be clear anyway.
Telegram has the ability to track message changes, but deletion is not tracked in any way using their API.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question