from aiohttp import BasicAuth
from aiogram.client.session.aiohttp import AiohttpSession
auth = BasicAuth(login='login', password='password')
session = AiohttpSession(proxy=('http://proxy.com:8585', auth))
def main() -> None:
bot = Bot(TELEGRAM_API_TOKEN, session=session, parse_mode="HTML")
dp.run_polling(bot)
if __name__ == "__main__":
if platform.system() == 'Windows':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
main()
Документация aiogram3
#aiogram3
#aiogram_3.0.0.b4