Answer the question
In order to leave comments, you need to log in
How to implement input in telebot?
Right now I have a function that accepts all messages and then
@bot.message_handler(func=lambda m: True)
def messages(message):
if 'hello' in message.text:
hello(message)
else:
something(message)
Answer the question
In order to leave comments, you need to log in
In general, I came up with this solution: I store the user's state in the database, when it comes to the introduction of color, I check the state, thereby blocking all other functions, it's easier to show
the get_current_state() function requests the user's state when he wants to specify something, his state from regular changes to for example color_except ( condition != regular, purely for example), this decorator weighs higher than others, therefore it is executed first, which blocks other functions, I will be glad if someone has to
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question