1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

added examples of multibot

This commit is contained in:
abdullaev388
2022-05-11 10:50:33 +05:00
parent a2f3cd03e1
commit 42955d1886
10 changed files with 195 additions and 0 deletions

View File

@ -0,0 +1,14 @@
from telebot import types, TeleBot
def hello_handler(message: types.Message, bot: TeleBot):
bot.send_message(message.chat.id, "Hi :)")
def echo_handler(message: types.Message, bot: TeleBot):
bot.send_message(message.chat.id, message.text)
def register_handlers(bot: TeleBot):
bot.register_message_handler(hello_handler, func=lambda message: message.text == 'Hello', pass_bot=True)
bot.register_message_handler(echo_handler, pass_bot=True)