summary refs log tree commit diff
path: root/src/api/routes/guilds/index.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 00:44:13 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-08-25 00:44:13 +1000
commit314a4787ce55a091cb89ef4281d7ba09e8323fa4 (patch)
treed77142c009e9c6d45390a8fe01c9aee966d7a4cc /src/api/routes/guilds/index.ts
parentMerge remote-tracking branch 'upstream/staging' into feat/captchaVerify (diff)
parentcase insensitive header for rate limits, fix rate limit default settings (diff)
downloadserver-314a4787ce55a091cb89ef4281d7ba09e8323fa4.tar.xz
Merge remote-tracking branch 'upstream/staging' into feat/captchaVerify
Diffstat (limited to 'src/api/routes/guilds/index.ts')
-rw-r--r--src/api/routes/guilds/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/routes/guilds/index.ts b/src/api/routes/guilds/index.ts
index e4d66192..6946e2f7 100644
--- a/src/api/routes/guilds/index.ts
+++ b/src/api/routes/guilds/index.ts
@@ -1,6 +1,6 @@
-import { Router, Request, Response } from "express";
-import { Role, Guild, Snowflake, Config, getRights, Member, Channel, DiscordApiErrors, handleFile, GuildCreateSchema } from "@fosscord/util";
 import { route } from "@fosscord/api";
+import { Config, DiscordApiErrors, getRights, Guild, GuildCreateSchema, Member } from "@fosscord/util";
+import { Request, Response, Router } from "express";
 
 const router: Router = Router();
 
@@ -12,7 +12,7 @@ router.post("/", route({ body: "GuildCreateSchema", right: "CREATE_GUILDS" }), a
 	const { maxGuilds } = Config.get().limits.user;
 	const guild_count = await Member.count({ where: { id: req.user_id } });
 	const rights = await getRights(req.user_id);
-	if ((guild_count >= maxGuilds)&&!rights.has("MANAGE_GUILDS")) {
+	if (guild_count >= maxGuilds && !rights.has("MANAGE_GUILDS")) {
 		throw DiscordApiErrors.MAXIMUM_GUILDS.withParams(maxGuilds);
 	}