mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
automod: add role_added and role_removed triggers
This commit is contained in:
parent
bfa9cf55a7
commit
4c7a51f586
9 changed files with 187 additions and 4 deletions
|
@ -9,6 +9,7 @@ import { LogsPlugin } from "../../Logs/LogsPlugin";
|
|||
import { missingPermissionError } from "../../../utils/missingPermissionError";
|
||||
import { canAssignRole } from "../../../utils/canAssignRole";
|
||||
import { Constants } from "eris";
|
||||
import { ignoreRoleChange } from "../functions/ignoredRoleChanges";
|
||||
|
||||
const p = Constants.Permissions;
|
||||
|
||||
|
@ -57,6 +58,7 @@ export const RemoveRolesAction = automodAction({
|
|||
const memberRoles = new Set(member.roles);
|
||||
for (const roleId of rolesToRemove) {
|
||||
memberRoles.delete(roleId);
|
||||
ignoreRoleChange(pluginData, member.id, roleId);
|
||||
}
|
||||
|
||||
if (memberRoles.size === member.roles.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue