FunctionsRole Functions
$role
A powerful and compact function to retrieve various properties of a Discord role!
Usage
$role[roleid;property]This function takes two arguments:
roleid: The ID of the role you want to get information from.property: The specific piece of information you want to retrieve.
Supported Properties:
Here's a list of the available properties you can use with the $role function:
name: The role's name (e.g., "Moderator").mention: The role's mention string (e.g.,<@&1234567890>).id: The role's ID (e.g.,1234567890).hex: The role's color in hexadecimal format (e.g.,FF0000for red).color: The role's primary color as a 10-base number.primaryColor: Same ascolor.secondColor: The role's secondary color as a 10-base number, if it has a gradient color.thirdColor: The role's third color as a 10-base number, if it has a third color.primaryHex: The role's primary color in hexadecimal format.secondHex: The role's secondary color in hexadecimal format, orundefinedif no secondary color is set.thirdHex: The role's third color in hexadecimal format, orundefinedif no third color is set.created: The date and time when the role was created.position: The role's position in the role hierarchy. Lower numbers mean higher priority.rawposition: The role's raw position in the role list.guildid: The ID of the guild (server) where the role exists.guildname: The name of the guild (server) where the role exists.timestamp: The creation timestamp of the role.ismentionable: Returnstrueif the role can be mentioned,falseotherwise.iseditable: Returnstrueif the bot can edit the role,falseotherwise.ismanaged: Returnstrueif the role is managed by an integration (like a bot),falseotherwise.ishoisted: Returnstrueif the role is hoisted (displayed separately in the member list),falseotherwise.usercount: The number of users who have this role. (Note: This value is cached and might not be perfectly up-to-date.)icon: Returns the role's icon URL if it exists. Returnsundefinedif the role has no icon.
Example:
Member
9/5/2026
!!exec $role[798789079070970;position]
Custom Command
APP
9/5/2026
2
This example retrieves the position of the role with the ID 798789079070970. The bot responds with 2, indicating the role's position in the role hierarchy.
Function difficulty: Easy
Tags: Compact Role