28 lines
666 B
Python
28 lines
666 B
Python
import asyncio
|
|
import logging
|
|
|
|
from aiogram import Bot, F
|
|
from aiogram import Dispatcher
|
|
from aiogram import types
|
|
from aiogram.client.default import DefaultBotProperties
|
|
from aiogram.enums import ParseMode
|
|
from routers import router as main_router
|
|
from utils.db import init_db
|
|
|
|
import config
|
|
|
|
async def main ():
|
|
dp = Dispatcher()
|
|
dp.include_router(main_router)
|
|
logging.basicConfig(level=logging.INFO)
|
|
bot = Bot(token=config.BOT_TOKEN,
|
|
default=DefaultBotProperties(
|
|
parse_mode=ParseMode.HTML
|
|
)
|
|
)
|
|
await init_db()
|
|
await dp.start_polling(bot)
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|