import asyncio import logging.config from aiogram import Bot, Dispatcher from aiogram.filters import Command, CommandStart from aiogram.types import Message from app.telegram.database.models import async_main from app.telegram.handlers.handlers import router from app.telegram.functions.main_settings.settings import router_main_settings from app.telegram.functions.risk_management_settings.settings import router_risk_management_settings from app.telegram.functions.condition_settings.settings import condition_settings_router from app.services.Bybit.functions.Add_Bybit_API import router_register_bybit_api from app.services.Bybit.functions.functions import router_functions_bybit_trade from logger_helper.logger_helper import LOGGING_CONFIG from config import TOKEN_TG_BOT_1, TOKEN_TG_BOT_2, TOKEN_TG_BOT_3 logging.config.dictConfig(LOGGING_CONFIG) logger = logging.getLogger("main") bot = Bot(token=TOKEN_TG_BOT_1) dp = Dispatcher() async def main(): await async_main() dp.include_router(router) dp.include_router(router_main_settings) dp.include_router(router_risk_management_settings) dp.include_router(condition_settings_router) dp.include_router(router_register_bybit_api) dp.include_router(router_functions_bybit_trade) await dp.start_polling(bot) if __name__ == '__main__': try: logger.info("Bot is on") asyncio.run(main()) except KeyboardInterrupt: logger.info("Bot is off")