From 987d9c5090b6be2d8c153de8a47e46b5bf481fea Mon Sep 17 00:00:00 2001 From: ochen1 Date: Sat, 8 Apr 2023 22:43:54 -0600 Subject: [PATCH] Add ability to get member permissions through guild member API --- src/api/routes/guilds/#guild_id/members/#member_id/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts index a14691f2b..f2c18181e 100644 --- a/src/api/routes/guilds/#guild_id/members/#member_id/index.ts +++ b/src/api/routes/guilds/#guild_id/members/#member_id/index.ts @@ -19,6 +19,7 @@ import { Request, Response, Router } from "express"; import { Member, + Permissions, getPermission, getRights, Role, @@ -42,7 +43,9 @@ router.get("/", route({}), async (req: Request, res: Response) => { where: { id: member_id, guild_id }, }); - return res.json(member); + const permission = await getPermission(member_id, guild_id); + + return res.json({...member, permissions: Permissions.resolve(permission).toString()}); }); router.patch(