Template
Fix arguments middleware and add state storage
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
from telebot import TeleBot
|
||||
from telebot import types as tt
|
||||
from telebot.types import Message
|
||||
|
||||
|
||||
def start(message: tt.Message, bot: TeleBot, logger, t):
|
||||
def start(message: Message, bot: TeleBot, t, **kwargs):
|
||||
bot.send_message(message.chat.id, t("start"))
|
||||
|
||||
|
||||
def help_(message: tt.Message, bot: TeleBot, logger, t):
|
||||
def help_(message, bot, t, **kwargs):
|
||||
bot.send_message(message.chat.id, t("help"))
|
||||
|
||||
|
||||
def register_handlers(bot: TeleBot):
|
||||
bot.register_message_handler(start, commands=["start"])
|
||||
bot.register_message_handler(help_, commands=["help"])
|
||||
bot.register_message_handler(start, commands=["start"], pass_bot=True)
|
||||
bot.register_message_handler(help_, commands=["help"], pass_bot=True)
|
||||
|
||||
Reference in New Issue
Block a user