Answer the question
In order to leave comments, you need to log in
Telegram bot deleting all messages from everyone and everyone in the group?
Is it possible to write a bot that can delete all messages from the user in the chat, so that they are automatically deleted from everyone at a certain time or after some time?
Answer the question
In order to leave comments, you need to log in
The bot can delete messages, while observing a number of rules (see link). At a minimum, the bot needs to know the message_id and have enough rights to delete other people's messages.
import telebot
@bot.message_handler(content_types=['text'])
def delete_message(message):
bot.delete_message(message.chat.id, message.message_id)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question