From dccd90890dec0464f528b958988328aac269426f Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 1 Sep 2021 23:47:55 -0300 Subject: [PATCH] dms: represent dm response differently on api >v7 --- litecord/blueprints/dms.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/litecord/blueprints/dms.py b/litecord/blueprints/dms.py index 8871659..1bf33a1 100644 --- a/litecord/blueprints/dms.py +++ b/litecord/blueprints/dms.py @@ -47,6 +47,13 @@ async def get_dms(): async def jsonify_dm(dm_id: int, user_id: int): dm_chan = await app.storage.get_dm(dm_id, user_id) + + if request.discord_api_version > 7: + new_recipients = [] + for recipient_user in dm_chan["recipients"]: + new_recipients.append(recipient_user["id"]) + dm_chan["recipients"] = new_recipients + return jsonify(dm_chan)