Skip to content

Commit c441c72

Browse files
committed
Revert "fix: Unify API and gateway version constants (#3080)"
This reverts commit ff6464e.
1 parent ff6464e commit c441c72

4 files changed

Lines changed: 4 additions & 34 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ These changes are available on the `master` branch, but have not yet been releas
1919

2020
- Updated `Role.is_assignable()` to also check whether the bot has the `MANAGE_ROLES`
2121
permission. ([#3048](https://github.com/Pycord-Development/pycord/pull/3048))
22-
- Unified HTTP and voice gateway to use shared API version constants (v10) to avoid
23-
drift between REST and gateway versions.
24-
([#3080](https://github.com/Pycord-Development/pycord/pull/3080))
2522

2623
### Fixed
2724

discord/constants.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

discord/gateway.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
from . import utils
4343
from .activity import BaseActivity
44-
from .constants import GATEWAY_VERSION
4544
from .enums import SpeakingState
4645
from .errors import ConnectionClosed, InvalidArgument
4746

@@ -421,6 +420,7 @@ async def identify(self):
421420
},
422421
"compress": True,
423422
"large_threshold": 250,
423+
"v": 3,
424424
},
425425
}
426426

@@ -845,7 +845,7 @@ async def identify(self):
845845
@classmethod
846846
async def from_client(cls, client, *, resume=False, hook=None):
847847
"""Creates a voice websocket for the :class:`VoiceClient`."""
848-
gateway = f"wss://{client.endpoint}/?v={GATEWAY_VERSION}&encoding=json"
848+
gateway = f"wss://{client.endpoint}/?v=8"
849849
http = client._state.http
850850
socket = await http.ws_connect(gateway, compress=15)
851851
ws = cls(socket, loop=client.loop, hook=hook)

discord/http.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import aiohttp
4444

4545
from . import __version__, utils
46-
from .constants import API_VERSION
4746
from .errors import (
4847
DiscordServerError,
4948
Forbidden,
@@ -101,6 +100,8 @@
101100
MU = TypeVar("MU", bound="MaybeUnlock")
102101
Response = Coroutine[Any, Any, T]
103102

103+
API_VERSION: int = 10
104+
104105

105106
async def json_or_text(response: aiohttp.ClientResponse) -> dict[str, Any] | str:
106107
text = await response.text(encoding="utf-8")

0 commit comments

Comments
 (0)