diff --git a/backend/src/plugins/CustomEvents/actions/addRoleAction.ts b/backend/src/plugins/CustomEvents/actions/addRoleAction.ts index 87e94519..7833d431 100644 --- a/backend/src/plugins/CustomEvents/actions/addRoleAction.ts +++ b/backend/src/plugins/CustomEvents/actions/addRoleAction.ts @@ -28,8 +28,7 @@ export async function addRoleAction( if (event.trigger.type === "command" && !canActOn(pluginData, eventData.msg.member, target)) { throw new ActionError("Missing permissions"); } - const targetRoles = [...target.roles.cache.keys()]; - const rolesToAdd = (Array.isArray(action.role) ? action.role : [action.role]).filter(id => !targetRoles.includes(id)); + const rolesToAdd = (Array.isArray(action.role) ? action.role : [action.role]).filter(id => !target.roles.cache.has(id)); if (rolesToAdd.length === 0) { throw new ActionError("Target already has the role(s) specified"); }