1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

fix MANAGE_GUILDS; rename getRight to getRights

This commit is contained in:
binsky 2022-04-09 04:12:16 +02:00 committed by Erkin Alp Güney
parent 596c60e010
commit 88dd33a9a2

View File

@ -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