D
D
Dmitry2020-01-30 16:38:01
Bots
Dmitry, 2020-01-30 16:38:01

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

3 answer(s)
Z
Zudwa, 2020-01-30
@pembrock

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.

K
k0shaK, 2020-01-30
@k0shaK14

import telebot

@bot.message_handler(content_types=['text'])
def delete_message(message):
    bot.delete_message(message.chat.id, message.message_id)

P
pirog_x, 2022-03-08
@pirog_x

And how to do the same only in the aiogram library?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question