diff --git a/apps/tgbot/handlers/__init__.py b/apps/tgbot/handlers/__init__.py new file mode 100644 index 0000000..446e418 --- /dev/null +++ b/apps/tgbot/handlers/__init__.py @@ -0,0 +1 @@ +from . import default \ No newline at end of file diff --git a/apps/tgbot/handlers/default/__init__.py b/apps/tgbot/handlers/default/__init__.py new file mode 100644 index 0000000..0e3a5d3 --- /dev/null +++ b/apps/tgbot/handlers/default/__init__.py @@ -0,0 +1,6 @@ +from aiogram import Dispatcher + +from .start import start_cmd + +def setup(dp: Dispatcher): + dp.register_message_handler(start_cmd, commands=['start']) diff --git a/apps/tgbot/handlers/default/start.py b/apps/tgbot/handlers/default/start.py new file mode 100644 index 0000000..00298d4 --- /dev/null +++ b/apps/tgbot/handlers/default/start.py @@ -0,0 +1,7 @@ +from aiogram.types import Message +from loguru import logger + + +async def start_cmd(msg: Message): + logger.info(f"{msg.from_user.full_name} send /start") + await msg.answer("Basic reply") \ No newline at end of file