From bd09c3bdf3e3c3d52479f947983fcf2748ec1fdb Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Thu, 30 Jul 2020 20:40:57 +0300 Subject: [PATCH] automod: ignore errors in 'clean' action These are, in most cases, just that the message was already deleted before we got to it or similar. --- backend/src/plugins/Automod/actions/clean.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/plugins/Automod/actions/clean.ts b/backend/src/plugins/Automod/actions/clean.ts index 2e2b55ab..b3e69bf6 100644 --- a/backend/src/plugins/Automod/actions/clean.ts +++ b/backend/src/plugins/Automod/actions/clean.ts @@ -1,6 +1,7 @@ import * as t from "io-ts"; import { automodAction } from "../helpers"; import { LogType } from "../../../data/LogType"; +import { noop } from "../../../utils"; export const CleanAction = automodAction({ configType: t.boolean, @@ -28,7 +29,7 @@ export const CleanAction = automodAction({ pluginData.state.logs.ignoreLog(LogType.MESSAGE_DELETE, id); } - await pluginData.client.deleteMessages(channelId, messageIds); + await pluginData.client.deleteMessages(channelId, messageIds).catch(noop); } }, });