From 696ef6278ab6a4f48f5bc6ef46571691127b80be Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Fri, 23 Apr 2021 00:14:54 +0200 Subject: [PATCH] :bug: fix wrong permission in delete invite --- src/routes/invites/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/invites/index.ts b/src/routes/invites/index.ts index 7ffceb25..7f4ff59b 100644 --- a/src/routes/invites/index.ts +++ b/src/routes/invites/index.ts @@ -21,7 +21,8 @@ router.delete("/:invite_code", async (req: Request, res: Response) => { const { guild_id, channel_id } = invite; const perms = await getPermission(req.user_id, guild_id, channel_id); - if (!perms.has("MANAGE_GUILD") || !perms.has("MANAGE_CHANNELS")) throw new HTTPError("You aren't allow", 401); + if (!perms.has("MANAGE_GUILD") && !perms.has("MANAGE_CHANNELS")) + throw new HTTPError("You missing the MANAGE_GUILD or MANAGE_CHANNELS permission", 401); await InviteModel.deleteOne({ code }).exec();