Skip to content

Commit 6ace6ea

Browse files
authored
Fixed discord.Client raises exception due to missing on_socket_response
1 parent 782b7a9 commit 6ace6ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discord_slash/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self,
5959

6060
if not isinstance(client, commands.Bot) and not isinstance(client, commands.AutoShardedBot) and not override_type:
6161
self.logger.info("Detected discord.Client! It is highly recommended to use `commands.Bot`.")
62-
original_sock_event = self._discord.on_socket_response
62+
original_sock_event = self._discord.on_socket_response if hasattr(self._discord, "on_socket_response") else lambda x: None
6363

6464
def wrap(*args):
6565
original_sock_event(*args)

0 commit comments

Comments
 (0)