diff --git a/interactions/api/http/client.py b/interactions/api/http/client.py index c37210050..a1c8c291c 100644 --- a/interactions/api/http/client.py +++ b/interactions/api/http/client.py @@ -77,7 +77,11 @@ async def get_gateway(self) -> str: url: Any = await self._req.request( Route("GET", "/gateway") ) # typehinting Any because pycharm yells - return f'{url["url"]}?v=10&encoding=json' + try: + _url = f'{url["url"]}?v=10&encoding=json' + except TypeError: # seen a few times + _url = "wss://gateway.discord.gg?v=10&encoding=json" + return _url async def get_bot_gateway(self) -> Tuple[int, str]: """ @@ -87,7 +91,11 @@ async def get_bot_gateway(self) -> Tuple[int, str]: """ data: Any = await self._req.request(Route("GET", "/gateway/bot")) - return data["shards"], f'{data["url"]}?v=9&encoding=json' + try: + _url = f'{data["url"]}?v=10&encoding=json' + except TypeError: # seen a few times + _url = "wss://gateway.discord.gg?v=10&encoding=json" + return data["shards"], _url async def login(self) -> Optional[dict]: """