1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-25 11:43:07 +01:00

Prevent /invites/:code for bots

This commit is contained in:
Madeline 2023-05-12 14:05:28 +10:00
parent ba0d1bb6ff
commit 8ee792c2a2
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -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 },