diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-05-12 14:05:28 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-05-12 14:05:28 +1000 |
commit | 8ee792c2a2dcf1fdd7c32e94158b544899315aa4 (patch) | |
tree | 7618a59530e641367c0a75cf4ff625e163be9cb2 /src/api/routes | |
parent | Merge pull request #1052 from spacebarchat/feat/auto-create-bot-users (diff) | |
download | server-8ee792c2a2dcf1fdd7c32e94158b544899315aa4.tar.xz |
Prevent /invites/:code for bots
Diffstat (limited to 'src/api/routes')
-rw-r--r-- | src/api/routes/invites/index.ts | 3 |
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 }, |