1 files changed, 3 insertions, 2 deletions
diff --git a/src/routes/invites/index.ts b/src/routes/invites/index.ts
index df74e216..7f4ff59b 100644
--- a/src/routes/invites/index.ts
+++ b/src/routes/invites/index.ts
@@ -1,5 +1,5 @@
import { Router, Request, Response } from "express";
-import { getPermission, InviteModel, toObject } from "fosscord-server-util";
+import { getPermission, InviteModel, toObject } from "@fosscord/server-util";
import { HTTPError } from "lambert-server";
const router: Router = Router();
@@ -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();
|