From 379303520b1cbb0d777d05a2362a9df4006e636d Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Mon, 18 Oct 2021 21:22:35 +0100 Subject: Migrate to on_socket_event_type event Discord.py 2.0 (Namely this commit https://github.com/Rapptz/discord.py/commit/e2250d402e8ad035b2653eb411c8e744cc9eb3bf) removed the socket_response event, and replaced it with the socket_event_type event, which just sends the type of event triggered on the websocket. Since this event was removed, no socket stats were being incremented, as the event never triggered. I have looked through the rest of the bot, and we do not use the socket_response event type anywhere else. --- bot/exts/utils/internal.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bot/exts/utils/internal.py b/bot/exts/utils/internal.py index 879735945..96664929b 100644 --- a/bot/exts/utils/internal.py +++ b/bot/exts/utils/internal.py @@ -37,11 +37,10 @@ class Internal(Cog): self.eval.add_check(is_owner().predicate) @Cog.listener() - async def on_socket_response(self, msg: dict) -> None: + async def on_socket_event_type(self, event_type: str) -> None: """When a websocket event is received, increase our counters.""" - if event_type := msg.get("t"): - self.socket_event_total += 1 - self.socket_events[event_type] += 1 + self.socket_event_total += 1 + self.socket_events[event_type] += 1 def _format(self, inp: str, out: Any) -> Tuple[str, Optional[discord.Embed]]: """Format the eval output into a string & attempt to format it into an Embed.""" -- cgit v1.2.3