3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-13 21:35:02 +00:00

More rework progress, mostly done up to ModActions

This commit is contained in:
Dark 2021-06-01 04:33:02 +02:00
parent 52839cc9f3
commit 57893e7f76
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
38 changed files with 199 additions and 241 deletions
backend/src/plugins/Censor/util

View file

@ -4,6 +4,7 @@ import { SavedMessage } from "../../../data/entities/SavedMessage";
import { LogType } from "../../../data/LogType";
import { stripObjectToScalars, resolveUser } from "../../../utils";
import { disableCodeBlocks, deactivateMentions } from "knub/dist/helpers";
import { TextChannel } from "discord.js";
export async function censorMessage(
pluginData: GuildPluginData<CensorPluginType>,
@ -13,7 +14,8 @@ export async function censorMessage(
pluginData.state.serverLogs.ignoreLog(LogType.MESSAGE_DELETE, savedMessage.id);
try {
await pluginData.client.deleteMessage(savedMessage.channel_id, savedMessage.id, "Censored");
const channel = pluginData.guild.channels.resolve(savedMessage.channel_id) as TextChannel
await channel.messages.delete(savedMessage.id);
} catch {
return;
}