Class: GuildEmojiManager

GuildEmojiManager

Manages API methods for GuildEmojis and stores their cache.

Constructor

new GuildEmojiManager()

Source:

Extends

Members

cache :Collection.<Snowflake, GuildEmoji>

The cache of GuildEmojis
Type:
Overrides:
Source:

cacheType :Collection

The type of Collection of the Manager
Type:
  • Collection
Overrides:
Source:

(readonly) client :Client

The client that instantiated this Manager
Type:
Overrides:
Source:

guild :Guild

The guild this manager belongs to
Type:
Source:

(private, readonly) holds :function

The data structure belonging to this manager
Type:
  • function
Overrides:
Source:

Methods

create(attachment, name, optionsopt) → {Promise.<Emoji>}

Creates a new custom emoji in the guild.
Parameters:
Name Type Attributes Description
attachment BufferResolvable | Base64Resolvable The image for the emoji
name string The name for the emoji
options Object <optional>
Options
Properties
Name Type Attributes Description
roles Collection.<Snowflake, Role> | Array.<RoleResolvable> <optional>
Roles to limit the emoji to
reason string <optional>
Reason for creating the emoji
Source:
Returns:
The created emoji
Type
Promise.<Emoji>
Examples
// Create a new emoji from a url
guild.emojis.create('https://i.imgur.com/w3duR07.png', 'rip')
  .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))
  .catch(console.error);
// Create a new emoji from a file on your computer
guild.emojis.create('./memes/banana.png', 'banana')
  .then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))
  .catch(console.error);

resolve(emoji) → {GuildEmoji}

Resolves an EmojiResolvable to an Emoji object.
Parameters:
Name Type Description
emoji EmojiResolvable The Emoji resolvable to identify
Overrides:
Source:
Returns:
Type
GuildEmoji

resolveID(emoji) → {Snowflake}

Resolves an EmojiResolvable to an Emoji ID string.
Parameters:
Name Type Description
emoji EmojiResolvable The Emoji resolvable to identify
Overrides:
Source:
Returns:
Type
Snowflake

resolveIdentifier(emoji) → {string}

Resolves an EmojiResolvable to an emoji identifier.
Parameters:
Name Type Description
emoji EmojiIdentifierResolvable The emoji resolvable to resolve
Source:
Returns:
Type
string