add sock5
BOT_open_sesam/pipeline/head There was a failure building this commit
Details
BOT_open_sesam/pipeline/head There was a failure building this commit
Details
parent
5b0eafe695
commit
d57a88321e
9
main.py
9
main.py
|
|
@ -7,6 +7,7 @@ import sys
|
|||
from aiogram import Bot, Dispatcher
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.client.session.aiohttp import AiohttpSession
|
||||
|
||||
from handlers import register_all_handlers
|
||||
from config import config
|
||||
|
|
@ -17,9 +18,15 @@ BOT_TOKEN=os.environ.get('BOT_TOKEN')
|
|||
dp = Dispatcher()
|
||||
register_all_handlers(dp)
|
||||
|
||||
PROXY_URL = "socks5://docker7:1080"
|
||||
session = AiohttpSession(proxy=PROXY_URL)
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue