class GuildEmojiManager
extends
BaseGuildEmojiManagerexport class GuildEmojiManager extends BaseGuildEmojiManager
Manages API methods for GuildEmojis and stores their cache.
Collection<Snowflake, GuildEmoji> cache :
The cache of GuildEmojis
readonlyClient client :
The client that instantiated this Manager
Guild guild :
The guild this manager belongs to
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
createoptions: GuildEmojiCreateOptions) : Promise<GuildEmoji> (
options: GuildEmojiCreateOptions
Creates a new custom emoji in the guild.
Examples:
// Create a new emoji from a URL
guild.emojis.create({ attachment: 'https://i.imgur.com/w3duR07.png', name: '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({ attachment: './memes/banana.png', name: 'banana' })
.then(emoji => console.log(`Created new emoji with name ${emoji.name}!`))
.catch(console.error);
Returns: The created emoji
deleteemoji: EmojiResolvablereason?: string) : Promise<void> (
emoji: EmojiResolvable
reason?: string
Deletes an emoji.
editemoji: EmojiResolvableoptions: GuildEmojiEditOptions) : Promise<GuildEmoji> (
emoji: EmojiResolvable
options: GuildEmojiEditOptions
Edits an emoji.
Overload 1
Overload 2
fetchid: Snowflakeoptions?: BaseFetchOptions) : Promise<GuildEmoji> (
id: Snowflake
options?: BaseFetchOptions
Obtains one or more emojis from Discord, or the emoji cache if they're already available.
Examples:
// Fetch all emojis from the guild
message.guild.emojis.fetch()
.then(emojis => console.log(`There are ${emojis.size} emojis.`))
.catch(console.error);
// Fetch a single emoji
message.guild.emojis.fetch('222078108977594368')
.then(emoji => console.log(`The emoji name is: ${emoji.name}`))
.catch(console.error);
fetchAuthoremoji: EmojiResolvable) : Promise<User> (
emoji: EmojiResolvable
Fetches the author for this emoji
resolveemoji: EmojiResolvable) : GuildEmoji (
emoji: EmojiResolvable
Resolves an EmojiResolvable to an Emoji object.
Inherited from: BaseGuildEmojiManager
resolveIdemoji: EmojiResolvable) : Snowflake (
emoji: EmojiResolvable
Resolves an EmojiResolvable to an Emoji id string.
Inherited from: BaseGuildEmojiManager
resolveIdentifieremoji: EmojiIdentifierResolvable) : string | null (
emoji: EmojiIdentifierResolvable
Resolves an EmojiResolvable to an emoji identifier.
Inherited from: BaseGuildEmojiManager
valueOfCollection<Key, Holds> () :
Inherited from: DataManager