Fix arguments middleware and add state storage

This commit is contained in:
2024-07-21 01:58:18 +03:00
parent 41e459521f
commit 6ffae054c0
8 changed files with 37 additions and 29 deletions
+5 -5
View File
@@ -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)