From a989d5268038d062c08e82a09841eaaab394deab Mon Sep 17 00:00:00 2001 From: yepiwt Date: Sun, 3 Jan 2021 01:25:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20bo?= =?UTF-8?q?t.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tgbot/bot.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 apps/tgbot/bot.py diff --git a/apps/tgbot/bot.py b/apps/tgbot/bot.py new file mode 100644 index 0000000..d041b76 --- /dev/null +++ b/apps/tgbot/bot.py @@ -0,0 +1,18 @@ +from aiogram import Bot, Dispatcher, executor +from aiogram.contrib.fsm_storage.memory import MemoryStorage +from loguru import logger + +import config +import handlers + +storage = MemoryStorage() +telegram_bot = Bot(token=config.TELEGRAM_BOT_TOKEN) +dp = Dispatcher(telegram_bot, storage=storage) + +def on_startup(): + logger.info('Registering handlers') + handlers.default.setup(dp) + +if __name__ == '__main__': + on_startup() + executor.start_polling(dp,skip_updates=True) \ No newline at end of file