Skip to content

Commit ae31788

Browse files
fix: Set the websocket's token without referencing the httpclient (#1045)
* fix: Set the websocket's token without referencing the httpclient * fix: correct the websocket's headers * ci: correct from checks. Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b0b8423 commit ae31788

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interactions/api/gateway/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from aiohttp import ClientWebSocketResponse, WSMessage, WSMsgType
2424

25-
from ...base import get_logger
25+
from ...base import __version__, get_logger
2626
from ...client.enums import InteractionType, OptionType
2727
from ...client.models import Option
2828
from ...utils.missing import MISSING
@@ -149,7 +149,9 @@ def __init__(
149149
"timeout": 60,
150150
"autoclose": False,
151151
"compress": 0,
152-
"headers": {"User-Agent": self._http._req._headers["User-Agent"]},
152+
"headers": {
153+
"User-Agent": f"DiscordBot (https://github.com/interactions-py/library {__version__}) "
154+
},
153155
}
154156

155157
self._intents: Intents = intents

0 commit comments

Comments
 (0)