Remove bad banned words implementation

This commit is contained in:
Madeline
2022-12-17 18:45:42 +11:00
parent d1c90c8c09
commit 444e815690
9 changed files with 5 additions and 60 deletions
@@ -12,7 +12,6 @@ import {
Snowflake,
uploadFile,
MessageCreateSchema,
BannedWords,
DiscordApiErrors,
} from "@fosscord/util";
import { Router, Response, Request } from "express";
@@ -44,10 +43,6 @@ router.patch(
const { message_id, channel_id } = req.params;
var body = req.body as MessageCreateSchema;
if (body.content)
if (BannedWords.find(body.content))
throw DiscordApiErrors.AUTOMODERATOR_BLOCK;
const message = await Message.findOneOrFail({
where: { id: message_id, channel_id },
relations: ["attachments"],
@@ -15,7 +15,6 @@ import {
Role,
MessageCreateSchema,
ReadState,
BannedWords,
DiscordApiErrors,
} from "@fosscord/util";
import { HTTPError } from "lambert-server";
@@ -192,10 +191,6 @@ 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"],