Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2579](https://github.com/Pycord-Development/pycord/pull/2579))
- Added new `Subscription` object and related methods/events.
([#2564](https://github.com/Pycord-Development/pycord/pull/2564))
- Added ability to change the API's base URL with `Route.API_BASE_URL`.
([#2714](https://github.com/Pycord-Development/pycord/pull/2714))

### Fixed

Expand Down
4 changes: 3 additions & 1 deletion discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ async def json_or_text(response: aiohttp.ClientResponse) -> dict[str, Any] | str


class Route:
API_BASE_URL: str = "https://discord.com/api/v{API_VERSION}"

def __init__(self, method: str, path: str, **parameters: Any) -> None:
self.path: str = path
self.method: str = method
Expand All @@ -127,7 +129,7 @@ def __init__(self, method: str, path: str, **parameters: Any) -> None:

@property
def base(self) -> str:
return f"https://discord.com/api/v{API_VERSION}"
return self.API_BASE_URL.format(API_VERSION=API_VERSION)

@property
def bucket(self) -> str:
Expand Down
Loading