Emoji

export class Emoji extends Base
export class Emoji extends Base
Represents an emoji, see ApplicationEmoji, GuildEmoji and ReactionEmoji.

Extends

Base
constructor(client, emoji)
Constructs a new instance of the Emoji class
NameTypeOptionalDescription
clientClient<true>NoNone
emojiRawEmojiDataNoNone
animated:boolean | null
Whether or not the emoji is animated
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
Readonly
createdAt:Date | null
The time the emoji was created at, or null if unicode
Readonly
createdTimestamp:number | null
The timestamp the emoji was created at, or null if unicode
The emoji's id
Readonly
identifier:string
The identifier of this emoji, used for message reactions
name:string | null
The emoji's name
DeprecatedReadonly
url:string | null
Use imageURL instead.
Deprecated
Returns a URL for the emoji or null if this is not a custom emoji.
imageURL(options?):string | null
Returns a URL for the emoji or null if this is not a custom emoji.
Returns
NameTypeOptionalDescription
optionsBaseImageURLOptionsYesOptions for the image URL
toJSON():unknown
toString():string
When concatenated with a string, this automatically returns the text required to form a graphical emoji on Discord instead of the Emoji object.
Example
// Send a custom emoji from a guild:
const emoji = guild.emojis.cache.first();
msg.channel.send(`Hello! ${emoji}`);
// Send a custom emoji from a guild:
const emoji = guild.emojis.cache.first();
msg.channel.send(`Hello! ${emoji}`);
Example
// Send the emoji used in a reaction to the channel the reaction is part of
reaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);
// Send the emoji used in a reaction to the channel the reaction is part of
reaction.message.channel.send(`The emoji used was: ${reaction.emoji}`);
valueOf():string