From 9d557e2817bab9520c6009f69a9462f72214ac01 Mon Sep 17 00:00:00 2001 From: Luna Date: Sun, 29 Aug 2021 19:19:33 -0300 Subject: [PATCH] add stub for op 24 --- litecord/gateway/opcodes.py | 1 + litecord/gateway/websocket.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/litecord/gateway/opcodes.py b/litecord/gateway/opcodes.py index a36b099..f2415f8 100644 --- a/litecord/gateway/opcodes.py +++ b/litecord/gateway/opcodes.py @@ -48,3 +48,4 @@ class OP: LAZY_REQUEST = 14 UNKNOWN_1 = 23 + UNKNOWN_2 = 24 diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index f487720..51b8841 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -1212,6 +1212,22 @@ class GatewayWebsocket: # TODO reverse-engineer opcode 23, sent by client pass + async def handle_24(self, payload): + """OP 24 Guild Application Commands Request""" + data = payload["d"] + + # stubbed + await self.dispatch( + "GUILD_APPLICATION_COMMANDS_UPDATE", + { + "updated_at": 1630271377245, + "nonce": data["nonce"], + "guild_id": data["guild_id"], + "applications": [], + "application_commands": [], + }, + ) + async def _process_message(self, payload): """Process a single message coming in from the client.""" try: