# mergeRoles

`function` in `core` · v0.1.4

<https://docs.seedcord.org/packages/core/0.1.4/functions/merge-roles>

The role ids a member holds after adding and removing the given sets. Removals win over additions.

This does not write the roles. Apply the result with `member.roles.set()` on gateway, or PATCH the member over HTTP.

```ts
mergeRoles(
    current: readonly string[],
    add: readonly string[],
    remove: readonly string[]
): string[]
```

The role ids a member holds after adding and removing the given sets. Removals win over additions.

This does not write the roles. Apply the result with `member.roles.set()` on gateway, or PATCH the member over HTTP.

Parameters.

- `current` `readonly string[]` — The role ids the member holds.
- `add` `readonly string[]` — The role ids to add.
- `remove` `readonly string[]` — The role ids to remove.

Returns `string[]`.
