Custom Command
FunctionsRole Functions

$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.
Member
9/5/2026
!!exec $toggleRoles[$authorID;$roleID[Member +]]

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 built-in cooldown. Why? Read more about cooldowns here.

  • Cooldown: 6 seconds
  • Tracked By: User ID
  • Type: userupdate

Functions with the same type share cooldowns based on the same Tracked By value.

On this page