mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
Fix spam detection crash if a spam message is deleted before the spam filter applies
This commit is contained in:
parent
ee20363dd8
commit
88ed1d9313
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ import {
|
||||||
getRoleMentions,
|
getRoleMentions,
|
||||||
getUrlsInString,
|
getUrlsInString,
|
||||||
getUserMentions,
|
getUserMentions,
|
||||||
|
noop,
|
||||||
stripObjectToScalars,
|
stripObjectToScalars,
|
||||||
trimLines,
|
trimLines,
|
||||||
} from "../utils";
|
} from "../utils";
|
||||||
|
@ -270,7 +271,7 @@ export class SpamPlugin extends ZeppelinPlugin<ISpamPluginConfig> {
|
||||||
// Then, if enabled, remove the spam messages
|
// Then, if enabled, remove the spam messages
|
||||||
if (spamConfig.clean !== false) {
|
if (spamConfig.clean !== false) {
|
||||||
msgIds.forEach(id => this.logs.ignoreLog(LogType.MESSAGE_DELETE, id));
|
msgIds.forEach(id => this.logs.ignoreLog(LogType.MESSAGE_DELETE, id));
|
||||||
this.bot.deleteMessages(savedMessage.channel_id, msgIds);
|
this.bot.deleteMessages(savedMessage.channel_id, msgIds).catch(noop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the ID of the last handled message
|
// Store the ID of the last handled message
|
||||||
|
|
Loading…
Add table
Reference in a new issue