summary refs log tree commit diff
path: root/src/api/routes/guilds/#guild_id
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/guilds/#guild_id')
-rw-r--r--src/api/routes/guilds/#guild_id/roles/#role_id/members.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/api/routes/guilds/#guild_id/roles/#role_id/members.ts b/src/api/routes/guilds/#guild_id/roles/#role_id/members.ts
index 705848aa..539cd5d8 100644
--- a/src/api/routes/guilds/#guild_id/roles/#role_id/members.ts
+++ b/src/api/routes/guilds/#guild_id/roles/#role_id/members.ts
@@ -17,7 +17,7 @@
 */
 
 import { Router, Request, Response } from "express";
-import { Member, partition } from "@spacebar/util";
+import { DiscordApiErrors, Member, partition } from "@spacebar/util";
 import { route } from "@spacebar/api";
 
 const router = Router();
@@ -30,6 +30,9 @@ router.patch(
 		const { guild_id, role_id } = req.params;
 		const { member_ids } = req.body;
 
+		// don't mess with @everyone
+		if (role_id == guild_id) throw DiscordApiErrors.INVALID_ROLE;
+
 		const members = await Member.find({
 			where: { guild_id },
 			relations: ["roles"],