Answer the question
In order to leave comments, you need to log in
How to add name=GROUP_ID variable?
Hello, I have a problem, here is a piece of code:
import telebot
import config
from telebot import types
bot = telebot.TeleBot(config.TOKEN)
CROUP_ID = -1001475859310
@bot.message_handler(func=lambda message: message.entities is not None and message.chat.id == GROUP_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
ERROR - TeleBot: "NameError occurred, args=("name 'GROUP_ID' is not defined",)
Traceback (most recent call last):
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