3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +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 3883b5b749
commit 293a850075
38 changed files with 199 additions and 241 deletions

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;
}