mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Create continue_handling.py
This commit is contained in:
parent
982e642c73
commit
0fecf46201
23
examples/continue_handling.py
Normal file
23
examples/continue_handling.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
from telebot import TeleBot
|
||||||
|
from telebot.handler_backends import ContinueHandling
|
||||||
|
|
||||||
|
|
||||||
|
bot = TeleBot('TOKEN')
|
||||||
|
|
||||||
|
@bot.message_handler(commands=['start'])
|
||||||
|
def start(message):
|
||||||
|
bot.send_message(message.chat.id, 'Hello World!')
|
||||||
|
return ContinueHandling()
|
||||||
|
|
||||||
|
@bot.message_handler(commands=['start'])
|
||||||
|
def start2(message):
|
||||||
|
"""
|
||||||
|
This handler comes after the first one, but it will never be called.
|
||||||
|
But you can call it by returning ContinueHandling() in the first handler.
|
||||||
|
|
||||||
|
If you return ContinueHandling() in the first handler, the next
|
||||||
|
registered handler with appropriate filters will be called.
|
||||||
|
"""
|
||||||
|
bot.send_message(message.chat.id, 'Hello World2!')
|
||||||
|
|
||||||
|
bot.infinity_polling()
|
Loading…
Reference in New Issue
Block a user