mirror of
https://gitflic.ru/project/maks1ms/ocab.git
synced 2025-10-11 06:22:37 +03:00
Исправлены импорты внутри модулей, добавлены: модуль для исключений, скрипт инициализации путей, переделано подключение к бд
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
from src.modules.standart.config.config import yaml_load
|
||||
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
|
||||
|
||||
from asyncio import run
|
||||
from aiogram import Bot, Dispatcher
|
||||
|
||||
|
||||
async def main():
|
||||
try:
|
||||
bot = Bot(token=yaml_load["TELEGRAM"]["TOKEN"])
|
||||
database = connect_database()
|
||||
bot = Bot(token=get_config()["TELEGRAM"]["TOKEN"])
|
||||
|
||||
dp = Dispatcher()
|
||||
|
||||
await dp.start_polling(bot)
|
||||
|
||||
finally:
|
||||
await bot.session.close()
|
||||
database.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user