cmd.role.info
Retrieves detailed information about a role in the guild.
JavaScript
const { cmd } = require("syntx.js");
await cmd.role.info(role, message);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
role | string | Yes | The role ID to look up. |
message | discord.js Message | Yes | A guild message or interaction, used to access the guild. |
Returns
An object with the following fields:
| Field | Type | Description |
|---|---|---|
id | string | The role's ID. |
name | string | The role's name. |
color | string | The role's primary color as a hex string (e.g. "#ff5733"). |
colorStyle | string | The color style: "solid", "gradient", or "holographic". |
colors | object | The full color set: { primary, secondary, tertiary }. Non-set values are null. |
icon | string | null | URL of the role icon at 512px, or null if no icon is set. |
unicodeEmoji | string | null | The role's unicode emoji, if set. |
position | number | The role's position in the hierarchy. |
permissions | string[] | Array of permission flag strings granted by the role. |
hoist | boolean | Whether members with this role are shown separately in the member list. |
mentionable | boolean | Whether the role can be mentioned by anyone. |
managed | boolean | Whether the role is managed by an integration (e.g. a bot role). |
editable | boolean | Whether the bot can edit this role. |
flags | string[] | Array of role flag strings. |
tags | object | null | Role tags, if any. See tags below. |
assignedMembers | number | Number of cached members currently assigned this role. |
createdAt | Date | When the role was created. |
Tags
The tags field is null for regular roles. For special roles it contains:
| Field | Type | Description |
|---|---|---|
botId | string | null | ID of the bot this role is linked to, if it is a bot role. |
integrationId | string | null | ID of the integration that manages this role, if any. |
premiumSubscriberRole | boolean | Whether this is the server's Nitro booster role. |
subscriptionListingId | string | null | ID of the subscription listing, if applicable. |
availableForPurchase | boolean | Whether the role is available for purchase. |
guildConnections | boolean | Whether the role is linked via guild connections. |
Example
JavaScript
client.command({
name: "roleinfo",
content: async (message) => {
const id = cmd.message.argument(1, message);
if (!id) return message.reply("Please provide a role ID.");
const info = await cmd.role.info(id, message);
message.reply([
`**Name:** ${info.name}`,
`**Color:** ${info.color} (${info.colorStyle})`,
`**Position:** ${info.position}`,
`**Hoisted:** ${info.hoist}`,
`**Mentionable:** ${info.mentionable}`,
`**Members:** ${info.assignedMembers}`,
].join("\n"));
},
});Note
assignedMembers reflects only the members currently in the guild cache. In large servers without the GuildMembers intent, this count may be lower than the actual number of members with the role.