From 42c3d9089816011007af8cce4d546aec1627675c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Intevel=20=E3=83=84?= <59223342+Intevel@users.noreply.github.com> Date: Sat, 8 May 2021 14:15:46 +0200 Subject: [PATCH] Update members.ts --- src/routes/guilds/#guild_id/members.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/routes/guilds/#guild_id/members.ts b/src/routes/guilds/#guild_id/members.ts index 9c6efe32..49621469 100644 --- a/src/routes/guilds/#guild_id/members.ts +++ b/src/routes/guilds/#guild_id/members.ts @@ -50,6 +50,8 @@ router.get("/:member_id", async (req: Request, res: Response) => { router.put("/:member_id", async (req: Request, res: Response) => { const { guild_id, member_id } = req.params; + throw new HTTPError("Maintenance: Currently you can't add a member", 403) + // TODO: only for oauth2 applications await addMember(member_id, guild_id); res.sendStatus(204) }); @@ -58,6 +60,9 @@ router.put("/:member_id", async (req: Request, res: Response) => { router.delete("/:member_id", async (req: Request, res: Response) => { const { guild_id, member_id } = req.params; + const perms = await getPermission(req.user_id, guild_id); + perms.hasThrow("KICK_MEMBERS"); + await removeMember(member_id, guild_id); res.sendStatus(204) });