2023-12-10 19:04:17 +03:00
|
|
|
from src.modules.standard.config.config import get_config
|
|
|
|
from src.modules.standard.database.models.base import database
|
|
|
|
from src.modules.standard.database.api import connect_database
|
2023-11-30 16:23:37 +03:00
|
|
|
|
|
|
|
from asyncio import run
|
|
|
|
from aiogram import Bot, Dispatcher
|
|
|
|
|
2024-02-05 15:51:50 +03:00
|
|
|
|
2023-11-30 16:23:37 +03:00
|
|
|
async def main():
|
|
|
|
try:
|
2023-12-10 19:04:17 +03:00
|
|
|
database = connect_database()
|
|
|
|
bot = Bot(token=get_config()["TELEGRAM"]["TOKEN"])
|
|
|
|
|
2023-11-30 16:23:37 +03:00
|
|
|
dp = Dispatcher()
|
|
|
|
|
|
|
|
await dp.start_polling(bot)
|
|
|
|
|
|
|
|
finally:
|
|
|
|
await bot.session.close()
|
2023-12-10 19:04:17 +03:00
|
|
|
database.close()
|
2023-11-30 16:23:37 +03:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
run(main())
|