add sock5
BOT_open_sesam/pipeline/head There was a failure building this commit Details

main
korotkov 2026-04-01 11:11:11 +05:00
parent 5b0eafe695
commit d57a88321e
1 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import sys
from aiogram import Bot, Dispatcher from aiogram import Bot, Dispatcher
from aiogram.enums import ParseMode from aiogram.enums import ParseMode
from aiogram.client.default import DefaultBotProperties from aiogram.client.default import DefaultBotProperties
from aiogram.client.session.aiohttp import AiohttpSession
from handlers import register_all_handlers from handlers import register_all_handlers
from config import config from config import config
@ -17,9 +18,15 @@ BOT_TOKEN=os.environ.get('BOT_TOKEN')
dp = Dispatcher() dp = Dispatcher()
register_all_handlers(dp) register_all_handlers(dp)
PROXY_URL = "socks5://docker7:1080"
session = AiohttpSession(proxy=PROXY_URL)
async def main() -> None: async def main() -> None:
bot = Bot(token=BOT_TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML)) bot = Bot(
token=BOT_TOKEN
, session=session
, default=DefaultBotProperties(parse_mode=ParseMode.HTML)
)
await dp.start_polling(bot) await dp.start_polling(bot)