Files
telegram_bot_vpn/bot/main.py
2026-02-13 03:09:19 +05:00

26 lines
668 B
Python

from aiogram import Bot, Dispatcher
import asyncio
import logging
from bot.config import config
from bot.handlers import router as main_router
async def main():
# Настройка логирования
logging.basicConfig(level=logging.INFO)
# Инициализация бота и диспетчера
bot = Bot(token=config.BOT_TOKEN)
dp = Dispatcher()
# Регистрация роутеров (хендлеров)
dp.include_router(main_router)
# Запуск polling
try:
await dp.start_polling(bot)
finally:
await bot.session.close()
if __name__ == "__main__":
asyncio.run(main())