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:
parent
969c99173a
commit
edc5426369
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user