Answer the question
In order to leave comments, you need to log in
How does handlers work in python from telebot library?
Handlers work very interesting and not clear. It seems that there is a class for parent handlers, there are child ones that take the functions of the parent.
register_next_step_handler takes 2 arguments, a function and an object. So, like a regular handler, it adds a chat_id and a function to the dictionary (if I'm not mistaken), and here for me, to be honest, it doesn't match. the polling function works, and due to this, in principle, the script continuously receives events, then registers everything there, as a result: a key appears in the dictionary in the form of an ID chat and a callable function in the form of a value (but I can be wrong about this), and this is how everything happens that this function only fires after the next message?
I wanted to do something similar for VK, because I did not find any library that would repeat a similar function.
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