1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 20:52:42 +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 969c99173a
commit edc5426369

View File

@ -42,11 +42,11 @@ router.patch("/", route({ body: "GuildUpdateSchema"}), async (req: Request, res:
const { guild_id } = req.params; 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); const permission = await getPermission(req.user_id, guild_id);
if (!rights.has("MANAGE_GUILDS")||!permission.has("MANAGE_GUILD")) 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 // TODO: guild update check image