summary refs log tree commit diff
diff options
context:
space:
mode:
authorbinsky <timo@binsky.org>2022-04-09 04:12:16 +0200
committerErkin Alp Güney <erkinalp9035@gmail.com>2022-04-09 08:30:29 +0300
commitedc5426369f31d4ad70f54ab8cbece5482738f7e (patch)
treeddcc73af798382d171b68690586ff3ff774231e3
parentfix invite right enforcement (diff)
downloadserver-edc5426369f31d4ad70f54ab8cbece5482738f7e.tar.xz
fix MANAGE_GUILDS; rename getRight to getRights
-rw-r--r--api/src/routes/guilds/#guild_id/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/api/src/routes/guilds/#guild_id/index.ts b/api/src/routes/guilds/#guild_id/index.ts
index 8e1e74f7..4ec3df72 100644
--- a/api/src/routes/guilds/#guild_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/index.ts
@@ -42,11 +42,11 @@ router.patch("/", route({ body: "GuildUpdateSchema"}), async (req: Request, res:
 	const { guild_id } = req.params;
 	
 	
-	const rights = await getRight(req.user_id);
+	const rights = await getRights(req.user_id);
 	const permission = await getPermission(req.user_id, guild_id);
 	
 	if (!rights.has("MANAGE_GUILDS")||!permission.has("MANAGE_GUILD"))
-		throw DiscordApiErrors.MISSING_PERMISSIONS("MANAGE_GUILD");
+		throw DiscordApiErrors.MISSING_PERMISSIONS.withParams("MANAGE_GUILD");
 	
 	// TODO: guild update check image