mirror of
https://github.com/spacebarchat/server.git
synced 2026-08-26 11:19:49 +00:00
Remove bad banned words implementation
This commit is contained in:
+1
-2
@@ -1,7 +1,7 @@
|
||||
import "missing-native-js-functions";
|
||||
import { Server, ServerOptions } from "lambert-server";
|
||||
import { Authentication, CORS } from "./middlewares/";
|
||||
import { BannedWords, Config, initDatabase, initEvent } from "@fosscord/util";
|
||||
import { Config, initDatabase, initEvent } from "@fosscord/util";
|
||||
import { ErrorHandler } from "./middlewares/ErrorHandler";
|
||||
import { BodyParser } from "./middlewares/BodyParser";
|
||||
import { Router, Request, Response, NextFunction } from "express";
|
||||
@@ -38,7 +38,6 @@ export class FosscordServer extends Server {
|
||||
await Config.init();
|
||||
await initEvent();
|
||||
await initInstance();
|
||||
await BannedWords.init();
|
||||
|
||||
let logRequests = process.env["LOG_REQUESTS"] != undefined;
|
||||
if (logRequests) {
|
||||
|
||||
@@ -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