From 0cb6729e0c9ba698956d207073b16241d1f88afe Mon Sep 17 00:00:00 2001 From: yepiwt Date: Sun, 3 Jan 2021 01:24:25 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=B1=D0=B0=D0=B7=D0=BE=D0=B2=D1=8B=D0=B5=20handlers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tgbot/handlers/__init__.py | 1 + apps/tgbot/handlers/default/__init__.py | 6 ++++++ apps/tgbot/handlers/default/start.py | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 apps/tgbot/handlers/__init__.py create mode 100644 apps/tgbot/handlers/default/__init__.py create mode 100644 apps/tgbot/handlers/default/start.py 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