-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.py
26 lines (20 loc) · 609 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
from dotenv import load_dotenv
from handlers import start, get
import asyncio
import os
import logging
import sys
from aiogram import Bot, Dispatcher
from aiogram.client.default import DefaultBotProperties
load_dotenv()
dp = Dispatcher()
async def main():
bot = Bot(os.getenv('BOTAPI_TOKEN'),
default=DefaultBotProperties(parse_mode='html'))
lock = asyncio.Lock()
dp["lock"] = lock
dp.include_routers(start.router, get.router)
await dp.start_polling(bot)
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
asyncio.run(main())