diff --git a/litecord/gateway/opcodes.py b/litecord/gateway/opcodes.py index 2b6a256..c07914b 100644 --- a/litecord/gateway/opcodes.py +++ b/litecord/gateway/opcodes.py @@ -4,13 +4,21 @@ class OP: HEARTBEAT = 1 IDENTIFY = 2 STATUS_UPDATE = 3 + + # voice connection / disconnection VOICE_UPDATE = 4 VOICE_PING = 5 + RESUME = 6 RECONNECT = 7 REQ_GUILD_MEMBERS = 8 INVALID_SESSION = 9 + HELLO = 10 HEARTBEAT_ACK = 11 + + # request member / presence information GUILD_SYNC = 12 - UNKNOWN = 14 + + # request for lazy guilds + LAZY_REQUEST = 14 diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index da489ac..2068504 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -355,12 +355,30 @@ class GatewayWebsocket: async def handle_3(self, payload: Dict[str, Any]): """Handle OP 3 Status Update.""" - pass + presence = payload['d'] + + # update_status will take care of validation and + # setting new presence to state + await self.update_status(presence) async def handle_4(self, payload: Dict[str, Any]): """Handle OP 4 Voice Status Update.""" pass + async def _handle_5(self, payload: Dict[str, Any]): + """Handle OP 5 Voice Server Ping. + + packet's d structure: + + { + delay: num, + speaking: num, + ssrc: num + } + + """ + pass + async def handle_6(self, payload: Dict[str, Any]): """Handle OP 6 Resume.""" data = payload['d']