monty-python
monty-python copied to clipboard
fix: apply proxy to (almost) all requests
Right now, the BOT_PROXY_URL env variable only applies to bot.http_session. This PR expands this to more requests:
- All requests to the Discord API by the underlying disnake client (except interaction responses due to https://github.com/DisnakeDev/disnake/issues/261)
- GraphQL requests to GitHub
The GraphQL one was a bit annoying, since graphql-python doesn't have a proxy parameter itself. It does, however, support passing arbitrary kwargs to the created aiohttp.ClientSession, which we can use to set a proxy by providing a custom request_class=.