Emoji

class Emoji

A custom emoji owned by a guild.

Implements:

Properties

Property

Type

Description

animated

boolean | undefined

Indicates whether this emoji is animated.

available

boolean | undefined

createdAt

Date | null

When this emoji was created, decoded from the emoji snowflake.

guildId

string

Guild ID this emoji belongs to.

id

string | null | undefined

Emoji ID.

managed

boolean | undefined

name

string | null | undefined

Emoji name used for the colon syntax (:name:).

requireColons

boolean | null | undefined

roles

string[] | null | undefined

Role IDs allowed to use the emoji, or null when unrestricted.

user

User | null | undefined

User who created the emoji when Discord includes it.

Methods

async Emoji.delete(reason: string) → Promise<void>

Delete this emoji.

Parameters:
  • reason: Reason for deletion, shown in audit log.

async Emoji.edit(options: EmojiEditOptions) → Promise<Emoji>

Edit emoji properties.

Parameters:
  • options: Emoji properties to update (name, restricted roles).

Returns:

The updated emoji.

Emoji.getURL(size: number) → string | null

Get the CDN URL for this emoji image.

Parameters:
  • size: Optional image size in pixels (powers of 2, 16–4096).

Returns:

The CDN URL, or null if the emoji has no ID (unicode emoji).

Emoji.toMention() → string

Get the mention string for this emoji.

Returns:

The emoji mention string (<:name:id> or <a:name:id>).