class ApplicationEmojiManager
extends
CachedManager<Snowflake, ApplicationEmoji, EmojiResolvable>export class ApplicationEmojiManager extends CachedManager<Snowflake, ApplicationEmoji, EmojiResolvable>
Manages API methods for ApplicationEmojis and stores their cache.
ClientApplication application :
The application this manager belongs to
readonlyCollection<Key, Holds> cache :
The cache of items for this manager.
Inherited from: DataManager
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
createoptions: ApplicationEmojiCreateOptions) : Promise<ApplicationEmoji> (
options: ApplicationEmojiCreateOptions
Creates a new custom emoji of the application.
Examples:
// Create a new emoji from a URL
application.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
application.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: EmojiResolvable) : Promise<void> (
emoji: EmojiResolvable
Deletes an emoji.
editemoji: EmojiResolvableoptions: ApplicationEmojiEditOptions) : Promise<ApplicationEmoji> (
emoji: EmojiResolvable
options: ApplicationEmojiEditOptions
Edits an emoji.
Overload 1
Overload 2
fetchid: Snowflakeoptions?: BaseFetchOptions) : Promise<ApplicationEmoji> (
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 application
message.application.emojis.fetch()
.then(emojis => console.log(`There are ${emojis.size} emojis.`))
.catch(console.error);
// Fetch a single emoji
message.application.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
Overload 1
Overload 2
Overload 1
Overload 2
valueOfCollection<Key, Holds> () :
Inherited from: DataManager