$role
A `Compact Function` pertaining to a guild role with `15` options to choose from.

FUNCTION USAGE

  • $role[roleID;option]

Properties:

roleID - Define the role you're calling upon with an ID. property - Define the property by its name.

Options:

  1. 1.
    created
  2. 2.
    hex
  3. 3.
    id
  4. 4.
    isdeleted
  5. 5.
    iseditable
  6. 6.
    ishoisted
  7. 7.
    ismanaged
  8. 8.
    ismentionable
  9. 9.
    mention
  10. 10.
    name
  11. 11.
    postition
  12. 12.
    rawposition
  13. 13.
    guild
  14. 14.
    guildname
  15. 15.
    timestamp
Position starts at 1 Raw position starts 0
undefined is returned when the option data cannot be fetched
created
hex
id
isdeleted
iseditable
ishoisted
ismanaged
ismentionable
mention
name
position
rawposition
guild
guildname
timestamp

Returns the date and time at which the role was created.

Returns the hex color value of the role.

Returns the role ID.

Returns true or false if the role has been deleted from the guild.

  • True - Role is deleted or does not exist
  • False - Role is not deleted and still exists

Returns true or false if the role is editable by the bot user.

  • True - Role is editable by the user running the command
  • False - Role is not editable by the user running the command

Returns true or false if the role is hoisted.

Hoisted means that users wearing the role are hoisted to a specific position in the role manager
  • True - Role is hoisted
  • False - Role is not hoisted

Returns true or false if the role is managed by an external service.

The guild booster role is a good example of a managed role
  • True - Role is managed
  • False - Role is not managed

Returns true or false if the role is mentionable by the bot user.

  • True - Can be mentioned
  • False - Cannot be mentioned

Returns the roles mention.

Returns the roles name.

Returns the role position managed by the role manager

ALL positions start counting at 1
  • The highest role in the role list will be 1

Returns the role position managed by the DiscordAPI

ALL positions start counting at 0
  • The highest role in the role list will be 0

Returns the guild ID of the server that owns the role.

Returns the guild name of the server that owns the role.

Returns how long ago the role was created.

Example 1: Fetching manually defined role data.

1
bot.Command({
2
name: "role",
3
code: `
4
$role[$message[1];$message[2]]
5
`
6
})
Copied!

Example 2: Fetching manually defined role data with mention, name or ID.

1
bot.Command({
2
name: "role",
3
code: `
4
$role[$findRole[$message[1]];$message[2]]
5
`
6
})
Copied!
Last modified 6mo ago
Copy link