3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

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.
This commit is contained in:
Dragory 2020-07-30 20:40:57 +03:00
parent 557898e484
commit bd09c3bdf3
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -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);
}
},
});