Can I delete user messages with a Telegram bot?

Viewed 7501

In a private chat (a user and a Bot) is it possible to delete user messages (or text commands after pressing a custom keyboard button)to keep the chat clean and more readable?

I'm looking for a solution that acts like inline keyboard mechanism (a label for the button and a command to send).

I have tested the deletemessageasync and I was able to remove the Bot sent messages, but couldn't remove user messages.

Any idea?

4 Answers
https://api.telegram.org/bot123456:AAAAAAAAAA-5555-YOUBOT/deleteMessage?chat_id=-5555&message_id=800`

Your bot must be group administrator

To get the messages you can use:

https://api.telegram.org/bot123456:AAAAAAAAAA-5555-YOUBOT/getUpdates
Related