summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-05-12 14:05:28 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-05-12 14:05:28 +1000
commit8ee792c2a2dcf1fdd7c32e94158b544899315aa4 (patch)
tree7618a59530e641367c0a75cf4ff625e163be9cb2 /src
parentMerge pull request #1052 from spacebarchat/feat/auto-create-bot-users (diff)
downloadserver-8ee792c2a2dcf1fdd7c32e94158b544899315aa4.tar.xz
Prevent /invites/:code for bots
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/invites/index.ts3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/api/routes/invites/index.ts b/src/api/routes/invites/index.ts
index 5a9cd942..6de4d583 100644
--- a/src/api/routes/invites/index.ts
+++ b/src/api/routes/invites/index.ts
@@ -18,6 +18,7 @@
 
 import { route } from "@spacebar/api";
 import {
+	DiscordApiErrors,
 	emitEvent,
 	getPermission,
 	Guild,
@@ -75,6 +76,8 @@ router.post(
 		},
 	}),
 	async (req: Request, res: Response) => {
+		if (req.user_bot) throw DiscordApiErrors.BOT_PROHIBITED_ENDPOINT;
+
 		const { code } = req.params;
 		const { guild_id } = await Invite.findOneOrFail({
 			where: { code: code },