gateway.websocket: add implementation for _handle_3

- gateway.websocket: add dummy implementation for _handle_5
This commit is contained in:
Luna Mendes 2018-09-12 20:35:50 -03:00
parent dd4ae44080
commit 213eb328b2
2 changed files with 28 additions and 2 deletions

View File

@ -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

View File

@ -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']