From 05f9f27a0cc5abe8d6260f331c253a73cb1cb9b0 Mon Sep 17 00:00:00 2001 From: Catalyst4 <84055084+Catalyst4222@users.noreply.github.com> Date: Tue, 30 Aug 2022 01:03:07 -0400 Subject: [PATCH 1/3] fix: Set the websocket's token without referencing the httpclient --- interactions/api/gateway/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index 069a5babc..82518b1df 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -149,7 +149,7 @@ def __init__( "timeout": 60, "autoclose": False, "compress": 0, - "headers": {"User-Agent": self._http._req._headers["User-Agent"]}, + "headers": {"User-Agent": token}, } self._intents: Intents = intents From e5665bcc9a153e3a48be9cc579a351d9e4653cb4 Mon Sep 17 00:00:00 2001 From: Catalyst4 <84055084+Catalyst4222@users.noreply.github.com> Date: Tue, 30 Aug 2022 11:12:55 -0400 Subject: [PATCH 2/3] fix: correct the websocket's headers --- interactions/api/gateway/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index 82518b1df..51dde47cf 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -22,7 +22,7 @@ from aiohttp import ClientWebSocketResponse, WSMessage, WSMsgType -from ...base import get_logger +from ...base import __version__, get_logger from ...client.enums import InteractionType, OptionType from ...client.models import Option from ...utils.missing import MISSING @@ -149,7 +149,7 @@ def __init__( "timeout": 60, "autoclose": False, "compress": 0, - "headers": {"User-Agent": token}, + "headers": {"User-Agent": f"DiscordBot (https://github.com/interactions-py/library {__version__}) "}, } self._intents: Intents = intents From 657e8a1aa82944aa14265ea802bedd1ea3ff34b3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 15:14:05 +0000 Subject: [PATCH 3/3] ci: correct from checks. --- interactions/api/gateway/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interactions/api/gateway/client.py b/interactions/api/gateway/client.py index 51dde47cf..4b8680f95 100644 --- a/interactions/api/gateway/client.py +++ b/interactions/api/gateway/client.py @@ -149,7 +149,9 @@ def __init__( "timeout": 60, "autoclose": False, "compress": 0, - "headers": {"User-Agent": f"DiscordBot (https://github.com/interactions-py/library {__version__}) "}, + "headers": { + "User-Agent": f"DiscordBot (https://github.com/interactions-py/library {__version__}) " + }, } self._intents: Intents = intents