mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-15 14:15:03 +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
backend/src/plugins/Automod/actions
|
@ -8,6 +8,7 @@ import { LogsPlugin } from "../../Logs/LogsPlugin";
|
|||
import { getMissingPermissions } from "../../../utils/getMissingPermissions";
|
||||
import { canAssignRole } from "../../../utils/canAssignRole";
|
||||
import { missingPermissionError } from "../../../utils/missingPermissionError";
|
||||
import { ignoreRoleChange } from "../functions/ignoredRoleChanges";
|
||||
|
||||
const p = Constants.Permissions;
|
||||
|
||||
|
@ -55,6 +56,7 @@ export const AddRolesAction = automodAction({
|
|||
const memberRoles = new Set(member.roles);
|
||||
for (const roleId of rolesToAssign) {
|
||||
memberRoles.add(roleId);
|
||||
ignoreRoleChange(pluginData, member.id, roleId);
|
||||
}
|
||||
|
||||
if (memberRoles.size === member.roles.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue