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],
|
extraNotes: [caseExtraNote],
|
||||||
};
|
};
|
||||||
const contactMethods = this.readContactMethodsFromAction(rule.actions.ban);
|
const contactMethods = this.readContactMethodsFromAction(rule.actions.ban);
|
||||||
|
const deleteMessageDays = rule.actions.ban.deleteMessageDays;
|
||||||
|
|
||||||
let userIdsToBan = [];
|
let userIdsToBan = [];
|
||||||
if (
|
if (
|
||||||
|
@ -1143,7 +1144,11 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
|
||||||
|
|
||||||
if (userIdsToBan.length) {
|
if (userIdsToBan.length) {
|
||||||
for (const userId of userIdsToBan) {
|
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");
|
actionsTaken.push("ban");
|
||||||
|
|
|
@ -262,6 +262,7 @@ export const BanAction = t.type({
|
||||||
reason: tNullable(t.string),
|
reason: tNullable(t.string),
|
||||||
notify: tNullable(t.string),
|
notify: tNullable(t.string),
|
||||||
notifyChannel: tNullable(t.string),
|
notifyChannel: tNullable(t.string),
|
||||||
|
deleteMessageDays: tNullable(t.number),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const AlertAction = t.type({
|
export const AlertAction = t.type({
|
||||||
|
|
Loading…
Add table
Reference in a new issue