automod: allow warn/mute/kick/ban for username, nickname, and custom status matching

This commit is contained in:
Dragory 2020-04-08 21:05:46 +03:00
parent 65112b39bb
commit 7485c7f7d7
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -1030,7 +1030,14 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
};
let membersToWarn = [];
if (matchResult.type === "message" || matchResult.type === "embed" || matchResult.type === "other") {
if (
matchResult.type === "message" ||
matchResult.type === "embed" ||
matchResult.type === "other" ||
matchResult.type === "username" ||
matchResult.type === "nickname" ||
matchResult.type === "customstatus"
) {
membersToWarn = [await this.getMember(matchResult.userId)];
} else if (matchResult.type === "textspam" || matchResult.type === "otherspam") {
for (const id of spamUserIdsToAction) {
@ -1057,7 +1064,14 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
const contactMethods = this.readContactMethodsFromAction(rule.actions.mute);
let userIdsToMute = [];
if (matchResult.type === "message" || matchResult.type === "embed" || matchResult.type === "other") {
if (
matchResult.type === "message" ||
matchResult.type === "embed" ||
matchResult.type === "other" ||
matchResult.type === "username" ||
matchResult.type === "nickname" ||
matchResult.type === "customstatus"
) {
userIdsToMute = [matchResult.userId];
} else if (matchResult.type === "textspam" || matchResult.type === "otherspam") {
userIdsToMute.push(...spamUserIdsToAction);
@ -1081,7 +1095,14 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
const contactMethods = this.readContactMethodsFromAction(rule.actions.kick);
let membersToKick = [];
if (matchResult.type === "message" || matchResult.type === "embed" || matchResult.type === "other") {
if (
matchResult.type === "message" ||
matchResult.type === "embed" ||
matchResult.type === "other" ||
matchResult.type === "username" ||
matchResult.type === "nickname" ||
matchResult.type === "customstatus"
) {
membersToKick = [await this.getMember(matchResult.userId)];
} else if (matchResult.type === "textspam" || matchResult.type === "otherspam") {
for (const id of spamUserIdsToAction) {
@ -1107,7 +1128,14 @@ export class AutomodPlugin extends ZeppelinPlugin<TConfigSchema, ICustomOverride
const contactMethods = this.readContactMethodsFromAction(rule.actions.ban);
let userIdsToBan = [];
if (matchResult.type === "message" || matchResult.type === "embed" || matchResult.type === "other") {
if (
matchResult.type === "message" ||
matchResult.type === "embed" ||
matchResult.type === "other" ||
matchResult.type === "username" ||
matchResult.type === "nickname" ||
matchResult.type === "customstatus"
) {
userIdsToBan = [matchResult.userId];
} else if (matchResult.type === "textspam" || matchResult.type === "otherspam") {
userIdsToBan.push(...spamUserIdsToAction);