Remove bad banned words implementation
This commit is contained in:
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user