discord.py 如何设置代理?有没有简单的方法让机器人通过代理运行?

7 Replies, 1545 Views

老哥,我之前也卡在这,后来发现用 `httpx` 代替 `aiohttp` 更简单。
discord.py 如何设置代理 的话,可以这样:
```python
import discord
import httpx

async with httpx.AsyncClient(proxies="http://你的代理地址") as client:
bot = discord.Client(http_client=client)
```
这个办法我觉得比改 `aiohttp` 方便多了,推荐试试!

Messages In This Thread



Users browsing this thread: 1 Guest(s)