Initial commit: UMB Telegram Bot

This commit is contained in:
Галингер Р.С.
2026-07-07 18:30:17 +07:00
commit 76e5701eba
31 changed files with 2524 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import logging
from aiogram import Bot, Dispatcher
from aiogram.client.default import DefaultBotProperties
from aiogram.client.session.aiohttp import AiohttpSession
from config import BOT_TOKEN, PROXY_ENABLED, PROXY_URL
logger = logging.getLogger(__name__)
session = AiohttpSession()
if PROXY_ENABLED and PROXY_URL:
session.proxy = PROXY_URL
bot = Bot(token=BOT_TOKEN, session=session, default=DefaultBotProperties(parse_mode="HTML"))
dp = Dispatcher()
async def setup_proxy():
if not PROXY_ENABLED or not PROXY_URL:
return
try:
me = await bot.me()
logger.info(f"Бот подключен через прокси: @{me.username}")
except Exception as e:
logger.error(f"Не могу соединиться с прокси сервером. Попробуй другой прокси. Ошибка: {e}")
raise