import asyncio
from aiogram import Dispatcher, Bot
from aiogram.filters import CommandStart
from aiogram.types import Message
token = 'tokentokentokentokentokentokentoken'
the_bot = Bot(token)
main_handler = Dispatcher()
@main_handler.message(CommandStart())
async def cmd_start(msg: Message) -> None:
await msg.answer('hi')
async def main():
await main_handler.start_polling(the_bot)
if __name__ == '__main__':
asyncio.run(main())
Running a Telegram bot off of my own computer. I live in Xi’An China so I can’t get to the API because Telegram is blocked here.
wath do?
2
Answers
Aiogram 3.1.1 didnot natively support proxy configuration, to use proxy for, you typically needed to use external Python libraries like aiosocksy or aiohttp. These libraries can be used to route your bot requests through a proxy server.
you can write like this