$rolePosition

Returns the position of a role in the server's role hierarchy. Roles with higher positions appear higher in the server's role list.

Usage:

$rolePosition[role ID]

Example:

$rolePosition[827482937492837492]

  • Replace 827482937492837492 with the actual role ID.

Example Scenario:

Let's say you have a custom command that checks the position of the "Muted" role.

Member04/23/2025
!!exec $rolePosition[$roleID[muted]]
Custom Command Bot 04/23/2025
2

Explanation:

  • !!exec $rolePosition[$roleID[muted]]: This command attempts to execute the $rolePosition function using the role ID of the role named "muted" (obtained via $roleID).
  • 2: The bot responds with 2, indicating that the "muted" role is in the 2nd position in the server's role hierarchy (higher numbers are generally higher positions, although some systems may number from 0).

Important Notes:

  • Role positions are relative to other roles within the server.
  • The role ID can be obtained by enabling Developer Mode in Discord (Settings > Advanced) and right-clicking on a role to copy its ID.
Function difficulty: Easy