Entity Info
roleCount
$roleCount
Returns the total number of roles on the Discord server.
Syntax
$roleCount[(guildID)]
$roleCount
The function $roleCount returns the total number of roles present on the Discord server, including the @everyone role.
Syntax
$roleCount[(guildID)]
Parameters
| Parameter | Description |
|---|---|
guildID |
Optional. The ID of the target server. If omitted, the current server is used. |
Return Value
| Type | Description |
|---|---|
integer |
The number of roles on the server. |
Examples
Number of roles
$sendMessage[This server has $roleCount roles.]
Server statistics
$sendMessage[
**Server Stats:**
Members: $memberCount
Roles: $roleCount
Channels: $channelCount
]
Check role limit
$if[$roleCount>=250]
$sendMessage[⚠️ Warning: This server is approaching the Discord limit of 250 roles.]
$endif
Notes
- Includes the
@everyonerole in the count. - The Discord limit is 250 roles per server.
- Useful for statistics or administrative checks.