Separated loader with dp, bot and storage and added app,

which we'll be executing
This commit is contained in:
Kostiantyn Kriuchkov
2020-04-14 10:54:17 +03:00
parent eab45a5088
commit 43b241d4e7
7 changed files with 28 additions and 27 deletions

14
loader.py Normal file
View File

@@ -0,0 +1,14 @@
import logging
from aiogram import Bot, Dispatcher, types
from aiogram.contrib.fsm_storage.redis import RedisStorage2
from data import config
bot = Bot(token=config.BOT_TOKEN, parse_mode=types.ParseMode.HTML)
storage = RedisStorage2(**config.aiogram_redis)
dp = Dispatcher(bot, storage=storage)
logging.basicConfig(format=u'%(filename)s [LINE:%(lineno)d] #%(levelname)-8s [%(asctime)s] %(message)s',
level=logging.INFO,
# level=logging.DEBUG,
)