Role

Role

Represents a role belonging to a guild.

Constructor

new Role(client, data, options)

Description:
  • Creates the structure for a role.

Source:
See:
Parameters:
Name Type Description
client Client

The client instance.

data Object

The raw role data from Discord.

options Object

Additional options for this structure.

Properties
Name Type Attributes Description
guildId String

The id of the guild that the role belongs to.

nocache Boolean <nullable>

Whether this role should be cached or not.

Members

(readonly) color :Number

Description:
  • The color of the role.

Source:

The color of the role.

Type:
  • Number

(readonly, nullable) displayIconURL :String

Description:
  • The icon URL of the role.

Source:

The icon URL of the role.

Type:
  • String

(readonly, nullable) guild :Guild

Description:
  • The guild that this role belongs to.

Source:

The guild that this role belongs to.

Type:

(readonly) guildId :String

Description:
  • The ID of the guild that this role belongs to.

Source:

The ID of the guild that this role belongs to.

Type:
  • String

(readonly) hoist

Description:
  • Whether the role is hoisted.

Source:

Whether the role is hoisted.

(readonly) id :String

Description:
  • The ID of the role.

Source:

The ID of the role.

Type:
  • String

(readonly) managed

Description:
  • Whether the role is managed (by an application).

Source:

Whether the role is managed (by an application).

(readonly) mention :String

Description:
  • Returns a mention for the role.

Source:

Returns a mention for the role.

Type:
  • String

(readonly) mentionable

Description:
  • Whether the role is mentionable.

Source:

Whether the role is mentionable.

(readonly) name :String

Description:
  • The name of the role.

Source:

The name of the role.

Type:
  • String

(readonly) permissions :String

Description:
  • The permissions for the role.

Source:

The permissions for the role.

Type:
  • String

(readonly) position :Number

Description:
  • The position of the role.

Source:

The position of the role.

Type:
  • Number

(readonly) tags :Object

Description:
  • The attributes of the role.

Source:

The attributes of the role.

Type:
  • Object

Methods

(static) getIconUrl(id, hashnullable) → {String}

Description:
  • Returns the URL of the role's icon.

Source:
Parameters:
Name Type Attributes Description
id String

The ID of the role.

hash String <nullable>

The hash of the role's icon.

Returns:
Type
String

(static) getMention(roleId) → {String}

Description:
  • Returns a mention for the role.

Source:
Parameters:
Name Type Description
roleId String

The ID of the role to mention.

Returns:
Type
String

(static) shouldCache(gluonCacheOptions, guildCacheOptions) → {Boolean}

Description:
  • Determines whether the role should be cached.

Source:
Parameters:
Name Type Description
gluonCacheOptions GluonCacheOptions

The cache options for the client.

guildCacheOptions GuildCacheOptions

The cache options for the guild.

Returns:
Type
Boolean

toJSON(format) → {Object}

Description:
  • Returns the JSON representation of this structure.

Source:
Parameters:
Name Type Description
format Number

The format to return the data in.

Returns:
Type
Object

toString()

Source: