$toggleRoles
Toggles roles on a user. This means it removes specified roles if the user already has them, and adds them if they don't.
Usage:
$toggleRoles[userID;roleID 1;roleID 2;roleID 3;...]
- userID: The ID of the user to toggle the roles on.
- roleID 1;roleID 2;roleID 3;...: A list of role IDs to toggle, separated by semicolons.
Example:
This example toggles the "Member +" role on the command executor. If the user has the role it will be removed, if they don't have it, it will be added.
Used Functions
$roleID, to get the ID of a role by name. This is used to dynamically find the role ID based on its name.
Related Functions
- $giveRoles: Gives roles to a user.
- $takeRoles: Removes roles from a user.
- $setRoles: Removes all existing roles from a user and then adds the specified roles.
Function difficulty: Medium
⏱️ Function Cooldown
This function has a built-in cooldown to help prevent excessive usage.
| Property | Value |
|---|---|
| ⏱️ Duration | 6 seconds |
| 🆔 Tracked By | User ID |
| 🌐 Scope | Userupdate |
Functions with the same Scope share cooldowns based on the same
Tracked Byvalue.
💎 Tier 3+ servers bypass this cooldown. See Premium Perks.