Answer the question
In order to leave comments, you need to log in
How to remove Telegram system notifications?
Tell me how to remove system notifications, who joined the group and who left the group, read a lot of information, but it doesn’t work, the most important thing is that the code be on the telebot library, or on another library, so that they are friends with each other, because I want everything to be in one file.
from telebot import TeleBot
from telebot import types
import time
bot = TeleBot('moy_token')
@bot.message_handler(content_types=['text'])
def message_handler(message):
bot.delete_message(message.chat.id, message.message_id)
@bot.message_handler(content_types=['text'])
async def my_event_handler(event):
bot.delete_message(message.chat.id, message.message_id)
@bot.message_handler(content_types=['text'])
def echo(message):
bot.delete_message(message.chat.id, message.message_id)
@bot.message_handler(content_types=['text'])
def deleted (message):
bot.delete_message(message.chat.id, message.message_id)
Answer the question
In order to leave comments, you need to log in
After that:
Paste this:
bot = TeleBot('moy_token')
@bot.message_handler(content_types = ['new_chat_members', 'left_chat_member'])
def delete(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