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

Automod: add deleteMessageDays option to ban action

This commit is contained in:
Dragory 2020-04-11 16:27:58 +03:00
parent 2971d1361e
commit e67816ec7b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 7 additions and 1 deletions

View file

@ -1126,6 +1126,7 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
extraNotes: [caseExtraNote],
};
const contactMethods = this.readContactMethodsFromAction(rule.actions.ban);
const deleteMessageDays = rule.actions.ban.deleteMessageDays;
let userIdsToBan = [];
if (
@ -1143,7 +1144,11 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
if (userIdsToBan.length) {
for (const userId of userIdsToBan) {
await this.getModActions().banUserId(userId, reason, { contactMethods, caseArgs });
await this.getModActions().banUserId(userId, reason, {
contactMethods,
caseArgs,
deleteMessageDays,
});
}
actionsTaken.push("ban");

View file

@ -262,6 +262,7 @@ export const BanAction = t.type({
reason: tNullable(t.string),
notify: tNullable(t.string),
notifyChannel: tNullable(t.string),
deleteMessageDays: tNullable(t.number),
});
export const AlertAction = t.type({