GuildEmoji

export class GuildEmoji extends BaseGuildEmoji
export class GuildEmoji extends BaseGuildEmoji
Represents a custom emoji.
animated:boolean | null
Whether or not the emoji is animated
Inherited from Emoji
author:User | null
The user who created this emoji
available:boolean | null
Whether this emoji is available
Inherited from BaseGuildEmoji
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
Readonly
createdAt:Date
The time the emoji was created at, or null if unicode
Inherited from BaseGuildEmoji
Readonly
createdTimestamp:number
The timestamp the emoji was created at, or null if unicode
Inherited from BaseGuildEmoji
Readonly
deletable:boolean
Whether the emoji is deletable by the client user
guild:Guild
The guild this emoji is part of
The emoji's id
Inherited from BaseGuildEmoji
Readonly
identifier:string
The identifier of this emoji, used for message reactions
Inherited from Emoji
managed:boolean | null
Whether this emoji is managed by an external service
Inherited from BaseGuildEmoji
name:string | null
The emoji's name
Inherited from Emoji
requiresColons:boolean | null
Whether or not this emoji requires colons surrounding it
Inherited from BaseGuildEmoji
Readonly
A manager for roles this emoji is active for.
DeprecatedReadonly
url:string
Use imageURL instead.
Deprecated
Returns a URL for the emoji.
Inherited from BaseGuildEmoji
delete(reason?):Promise<GuildEmoji>
Deletes the emoji.
NameTypeOptionalDescription
reasonstringYesReason for deleting the emoji
edit(options):Promise<GuildEmoji>
Edits the emoji.
Example
// Edit an emoji
emoji.edit({ name: 'newemoji' })
.then(emoji => console.log(`Edited emoji ${emoji}`))
.catch(console.error);
// Edit an emoji
emoji.edit({ name: 'newemoji' })
.then(emoji => console.log(`Edited emoji ${emoji}`))
.catch(console.error);
NameTypeOptionalDescription
optionsGuildEmojiEditOptionsNoThe options to provide
equals(other):boolean
Whether this emoji is the same as another one.
NameTypeOptionalDescription
otherGuildEmoji | unknownNoThe emoji to compare it to
fetchAuthor():Promise<User>
Fetches the author for this emoji
imageURL(options?):string
Returns a URL for the emoji.
NameTypeOptionalDescription
optionsBaseImageURLOptionsYesOptions for the image URL
Inherited from BaseGuildEmoji
setName(name, reason?):Promise<GuildEmoji>
Sets the name of the emoji.
NameTypeOptionalDescription
namestringNoThe new name for the emoji
reasonstringYesReason for changing the emoji's name
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}`);
Inherited from Emoji
valueOf():string