Members
(private, readonly) _roles :Collection.<Snowflake, Role>
The filtered collection of roles of the guild emoji
Type:
(readonly) cache :Collection.<Snowflake, Role>
The cache of roles belonging to this emoji
Type:
emoji :GuildEmoji
The emoji belonging to this manager
Type:
guild :Guild
The guild belonging to this manager
Type:
Methods
(private) _patch(roles)
Patches the roles for this manager's cache
Parameters:
Name | Type | Description |
---|---|---|
roles |
Array.<Snowflake> | The new roles |
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 |
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 |
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 |
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);