Class: GuildEmojiRoleManager

GuildEmojiRoleManager

Manages API methods for roles belonging to emojis and stores their cache.

Constructor

new GuildEmojiRoleManager()

Source:

Members

(private, readonly) _roles :Collection.<Snowflake, Role>

The filtered collection of roles of the guild emoji
Type:
Source:

(readonly) cache :Collection.<Snowflake, Role>

The cache of roles belonging to this emoji
Type:
Source:

emoji :GuildEmoji

The emoji belonging to this manager
Type:
Source:

guild :Guild

The guild belonging to this manager
Type:
Source:

Methods

(private) _patch(roles)

Patches the roles for this manager's cache
Parameters:
Name Type Description
roles Array.<Snowflake> The new roles
Source:

add(roleOrRoles) → {Promise.<GuildEmoji>}

Adds a role (or multiple roles) to the list of roles that can use this emoji.
Parameters:
Name Type Description
roleOrRoles RoleResolvable | Array.<RoleResolvable> | Collection.<Snowflake, Role> The role or roles to add
Source:
Returns:
Type
Promise.<GuildEmoji>

remove(roleOrRoles) → {Promise.<GuildEmoji>}

Removes a role (or multiple roles) from the list of roles that can use this emoji.
Parameters:
Name Type Description
roleOrRoles RoleResolvable | Array.<RoleResolvable> | Collection.<Snowflake, Role> The role or roles to remove
Source:
Returns:
Type
Promise.<GuildEmoji>

set(roles) → {Promise.<GuildEmoji>}

Sets the role(s) that can use this emoji.
Parameters:
Name Type Description
roles Collection.<Snowflake, Role> | Array.<RoleResolvable> The roles or role IDs to apply
Source:
Returns:
Type
Promise.<GuildEmoji>
Examples
// Set the emoji's roles to a single role
guildEmoji.roles.set(['391156570408615936'])
  .then(console.log)
  .catch(console.error);
// Remove all roles from an emoji
guildEmoji.roles.set([])
   .then(console.log)
   .catch(console.error);