M
M
Mikhail Mikhail2021-07-05 18:59:17
Python
Mikhail Mikhail, 2021-07-05 18:59:17

How to make another function run from callback_query_handler?

@bot.callback_query_handler(func=lambda call: True)
def callback_query(call):
  if call.data == "cb_rol":
    bot.register_next_step_handler(call.message, rol)

  elif call.data == "cb_dn":
    bot.answer_callback_query(call.id, "День")

@bot.message_handler(content_types=['text'])
def rol(message):
  print('test')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-07-05
@latty337

What's the other function? What are you currently unable to do? After a question has been asked, read it and consider whether everything about the question is clear.
If you want to call the rol function , you don't need to wrap it in a decorator.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question