-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (24 loc) · 872 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import asyncio
import logging
from aiogram import Bot, Dispatcher
from config_data.config import Config, load_config
from handlers import user_commands, user_text
from callback import callback_bank
logger = logging.getLogger(__name__)
async def main():
logging.basicConfig(
level=logging.INFO,
format='%(filename)s:%(lineno)d #%(levelname)-8s '
'[%(asctime)s] - %(name)s - %(message)s')
logger.info('БОТ ЗАПУЩЕН')
config: Config = load_config()
bot = Bot(token=config.tg_bot.token,
parse_mode='HTML')
dp = Dispatcher()
dp.include_router(user_commands.router)
dp.include_router(user_text.router)
dp.include_router(callback_bank.router)
await bot.delete_webhook(drop_pending_updates=True)
await dp.start_polling(bot)
if __name__ == '__main__':
asyncio.run(main())