Добавил bot.py

This commit is contained in:
yepiwt 2021-01-03 01:25:04 +03:00
parent 0cb6729e0c
commit a989d52680
No known key found for this signature in database
GPG Key ID: 5253B9F04F58780E

18
apps/tgbot/bot.py Normal file
View File

@ -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)