From 0736f99e452a4357fe0852655ba2110efd17b73c Mon Sep 17 00:00:00 2001 From: Erkin Alp Güney Date: Sun, 23 Jan 2022 17:46:04 +0300 Subject: Closed-join guilds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #537 Signed-off-by: Erkin Alp Güney --- api/src/routes/invites/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/src') diff --git a/api/src/routes/invites/index.ts b/api/src/routes/invites/index.ts index ac813126..37e9e05a 100644 --- a/api/src/routes/invites/index.ts +++ b/api/src/routes/invites/index.ts @@ -19,7 +19,8 @@ router.post("/:code", route({}), async (req: Request, res: Response) => { const { features } = await Guild.findOneOrFail({ id: guild_id}); const { public_flags } = await User.findOneOrFail({ id: req.user_id }); - if(features.includes("INTERNAL_EMPLOYEE_ONLY") && (public_flags & 1) !== 1) throw new HTTPError("The Maze isn't meant for you.", 401) + if(features.includes("INTERNAL_EMPLOYEE_ONLY") && (public_flags & 1) !== 1) throw new HTTPError("Only intended for the staff of this server.", 401); + if(features.includes("INVITES_CLOSED")) throw new HTTPError("Sorry, this guild has joins closed.", 403); const invite = await Invite.joinGuild(req.user_id, code); -- cgit 1.4.1