nickoala / telepot

Python framework for Telegram Bot API
MIT License
2.42k stars 474 forks source link

How can I clear the Conversation? #339

Open SA0-XDZ03 opened 7 years ago

SA0-XDZ03 commented 7 years ago

I want to embed an new command '/clear'. This should clear whole of the conversation.

das7pad commented 7 years ago

You could store all message ids per conversation in a dict with lists. Later you are able to delete messages of a specifiy conversation via telepot.Bot.deleteMessage(<chat_id>, <message_id>) or its async counterpart telepot.aio.Bot.deleteMessage(<chat_id>, <message_id>).