Answer the question
In order to leave comments, you need to log in
How to prevent the removal of a link, on behalf of a supergroup?
Tell me how to prevent the removal of links, on behalf of the super group.
import telebot
import time
from telebot import types
bot = telebot.TeleBot("Moy_token")
@bot.message_handler(func=lambda message: message.entities is not None and message.chat.id)
def delete_links(message):
for entity in message.entities:
if entity.type in ["url", "text_link"]:
bot.delete_message(message.chat.id, message.message_id)
else:
return
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question