From 9db9c7560219078b99d8d4207934815cba2ed58b Mon Sep 17 00:00:00 2001 From: Luna Mendes Date: Sun, 18 Nov 2018 01:24:32 -0300 Subject: [PATCH] gateway.websocket: fix extracting guild ids when handling op 8 --- litecord/blueprints/channel/messages.py | 2 -- litecord/gateway/websocket.py | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/litecord/blueprints/channel/messages.py b/litecord/blueprints/channel/messages.py index b961a39..df479ee 100644 --- a/litecord/blueprints/channel/messages.py +++ b/litecord/blueprints/channel/messages.py @@ -194,8 +194,6 @@ async def create_message(channel_id): for mention in payload['mentions']: uid = int(mention['id']) - print('updating user read state', repr(uid), repr(channel_id)) - await app.db.execute(""" UPDATE user_read_state SET mention_count = mention_count + 1 diff --git a/litecord/gateway/websocket.py b/litecord/gateway/websocket.py index 9be301e..68e6e7d 100644 --- a/litecord/gateway/websocket.py +++ b/litecord/gateway/websocket.py @@ -635,9 +635,11 @@ class GatewayWebsocket: 'members': result }) - async def handle_8(self, data: Any): + async def handle_8(self, payload: Dict): """Handle OP 8 Request Guild Members.""" + data = payload['d'] gids = data['guild_id'] + uids, query, limit = data.get('user_ids', []), \ data.get('query', ''), \ data.get('limit', 0)