D
D
Dmitry2021-01-13 16:26:43
Bots
Dmitry, 2021-01-13 16:26:43

Hello! how to make the telegram bot delete the notification about leaving the chat?

5ffef4b36d7fb903333318.png
python (telegrambotapi)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-01-13
@pagedimka

Execute deleteMessage , passing the chat ID and ID of this message to it.

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

upd - well, for those in need, there is also the new_chat_members event , which, oddly enough, is responsible for reporting new members

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question