Skip to content

Commit

Permalink
added support for discord proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
AMIT YADAV authored and AMIT YADAV committed Jun 14, 2024
1 parent e6c3f0d commit 05304d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from urllib.parse import quote as _uriquote

import aiohttp
import os

from . import __version__, utils
from .errors import (
Expand Down Expand Up @@ -123,6 +124,9 @@ def __init__(self, method: str, path: str, **parameters: Any) -> None:

@property
def base(self) -> str:
DISCORD_PROXY = bool(os.environ.get("DISCORD_PROXY", False))
if DISCORD_PROXY:
return f"http://discord.com/api/v{API_VERSION}"
return f"https://discord.com/api/v{API_VERSION}"

@property
Expand Down

0 comments on commit 05304d8

Please sign in to comment.