We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 982e642 commit 0fecf46Copy full SHA for 0fecf46
examples/continue_handling.py
@@ -0,0 +1,23 @@
1
+from telebot import TeleBot
2
+from telebot.handler_backends import ContinueHandling
3
+
4
5
+bot = TeleBot('TOKEN')
6
7
+@bot.message_handler(commands=['start'])
8
+def start(message):
9
+ bot.send_message(message.chat.id, 'Hello World!')
10
+ return ContinueHandling()
11
12
13
+def start2(message):
14
+ """
15
+ This handler comes after the first one, but it will never be called.
16
+ But you can call it by returning ContinueHandling() in the first handler.
17
18
+ If you return ContinueHandling() in the first handler, the next
19
+ registered handler with appropriate filters will be called.
20
21
+ bot.send_message(message.chat.id, 'Hello World2!')
22
23
+bot.infinity_polling()
0 commit comments