GuildEmojiRoleManager
classe · Source
Manages API methods for roles belonging to emojis and stores their cache.
Extends: DataManager
Properties
emoji
The emoji belonging to this manager Source
guild
The guild belonging to this manager Source
cache
The cache of roles belonging to this emoji Source
holds
The data structure belonging to this manager. Source
client
The client that instantiated this Manager Source
Methods
add
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: Promise<GuildEmoji>Source
remove
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: Promise<GuildEmoji>Source
set
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: Promise<GuildEmoji>
// 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);_patch
Patches the roles for this manager's cache Parameters
| Name | Type | Description |
|---|---|---|
roles | Array<Snowflake> | The new roles |
| Source |
resolve
Resolves a data entry to a data Object. Parameters
| Name | Type | Description |
|---|---|---|
idOrInstance | string | Object | The id or instance of something in this Manager |
Returns: Object — An instance from this Manager Source
resolveId
Resolves a data entry to an instance id. Parameters
| Name | Type | Description |
|---|---|---|
idOrInstance | string | Object | The id or instance of something in this Manager |
Returns: SnowflakeSource