Can a Telegram Bot Delete Its Chat History with a User?

134 Views Asked by At

I am developing a Telegram bot and am curious about a specific functionality regarding chat management. I'm looking to understand if it's possible for a Telegram bot to delete its chat history with a user. Here are my specific queries:

Does the Telegram Bot API allow a bot to delete the chat or conversation history it has with a user? If so, what are the methods or API calls required to implement this functionality?

1

There are 1 best solutions below

0
0stone0 On

A Telegram Bot can only delete the messages the Bot send himself.

You can use the deleteMessage method for this.

Keep in mind that you'll need to save all the ID's of the message's the Bot has ever send, you need those ID's to delete the message.

As of today there is no option to get a list of all historic messages send, you'll need to keep track of that yourself.