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:
parent
2971d1361e
commit
e67816ec7b
2 changed files with 7 additions and 1 deletions
|
@ -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");
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Add table
Reference in a new issue