diff options
Diffstat (limited to 'src/api/routes/channels/#channel_id/messages/index.ts')
-rw-r--r-- | src/api/routes/channels/#channel_id/messages/index.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts index e0c91b8a..ecbd1b19 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts @@ -15,6 +15,8 @@ import { Role, MessageCreateSchema, ReadState, + BannedWords, + DiscordApiErrors, } from "@fosscord/util"; import { HTTPError } from "lambert-server"; import { handleMessage, postHandleMessage, route } from "@fosscord/api"; @@ -190,6 +192,10 @@ router.post( var body = req.body as MessageCreateSchema; const attachments: Attachment[] = []; + if (body.content) + if (BannedWords.find(body.content)) + throw DiscordApiErrors.AUTOMODERATOR_BLOCK; + const channel = await Channel.findOneOrFail({ where: { id: channel_id }, relations: ["recipients", "recipients.user"], |