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:
parent
ba0d1bb6ff
commit
8ee792c2a2
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user