transcardbot/main.py

28 lines
560 B
Python

from os import environ
from logging import basicConfig, INFO
from asyncio import get_event_loop
from aiogram import Bot, Dispatcher
from aiogram.enums import ParseMode
from dotenv import load_dotenv
from handlers import router
load_dotenv()
async def main():
bot = Bot(
token=environ.get("TOKEN"),
parse_mode=ParseMode.HTML
)
dp = Dispatcher()
dp.include_router(router)
await dp.start_polling(bot)
if __name__ == "__main__":
basicConfig(level=INFO)
loop = get_event_loop()
loop.run_until_complete(main())