Answer the question
In order to leave comments, you need to log in
How to pass an additional element to the callback function?
How can I pass the user's message to the callback function?
@bot.message_handler(content_types=["text"])
def repeat_all_messages(message):
callbacks(message.text)
@bot.callback_query_handler(func=lambda call: True)
def callbacks(call, cards):
if call.data == "statTop":
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text=f"Спасибо, <code>{call.message.chat.username}</code>, за оценку!",
parse_mode='html')
print(cards)
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