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
1 change: 0 additions & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

from . import abc, utils
from .asset import Asset
from .channel import *
from .channel import _guild_channel_factory, _threaded_guild_channel_factory
from .colour import Colour
from .emoji import Emoji
Expand Down
12 changes: 5 additions & 7 deletions discord/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,10 @@
template,
threads,
user,
voice,
webhook,
welcome_screen,
widget,
)
from .types.message import Attachment
from .types.snowflake import Snowflake, SnowflakeList

T = TypeVar("T")
Expand All @@ -114,7 +112,7 @@ async def json_or_text(response: aiohttp.ClientResponse) -> Union[Dict[str, Any]


class Route:
BASE: ClassVar[str] = "https://discord.com/api/v9"
BASE: ClassVar[str] = "https://discord.com/api/v10"

def __init__(self, method: str, path: str, **parameters: Any) -> None:
self.path: str = path
Expand Down Expand Up @@ -2633,9 +2631,9 @@ async def get_gateway(self, *, encoding: str = "json", zlib: bool = True) -> str
except HTTPException as exc:
raise GatewayNotFound() from exc
if zlib:
value = "{0}?encoding={1}&v=9&compress=zlib-stream"
value = "{0}?encoding={1}&v=10&compress=zlib-stream"
else:
value = "{0}?encoding={1}&v=9"
value = "{0}?encoding={1}&v=10"
return value.format(data["url"], encoding)

async def get_bot_gateway(
Expand All @@ -2647,9 +2645,9 @@ async def get_bot_gateway(
raise GatewayNotFound() from exc

if zlib:
value = "{0}?encoding={1}&v=9&compress=zlib-stream"
value = "{0}?encoding={1}&v=10&compress=zlib-stream"
else:
value = "{0}?encoding={1}&v=9"
value = "{0}?encoding={1}&v=10"
return data["shards"], value.format(data["url"], encoding)

def get_user(self, user_id: Snowflake) -> Response[user.User]:
Expand Down