R
R
Rolzkapor2022-01-09 13:23:40
Python
Rolzkapor, 2022-01-09 13:23:40

Do I get an error when creating a Button through a telebot?

@bot.callback_query_handlers(func=lambda call: True)
def callback(call):
if call.message:
if call.data == "news":
bot.send_message(call.message.chat.id, newss)

Lists in program no, but PyCharm complains about list
@bot.callback_query_handlers(lambda call: True)
TypeError: 'list' object is not callable
Namely on the first line

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rolzkapor, 2022-01-09
@Rolzkapor

Issue resolved)
Instead of @bot.callback_query_handlerS(func=lambda call: True)
I wrote @bot.callback_query_handler(func=lambda call: True)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question