Emoji

class Emoji()

A custom emoji owned by a guild.

exported from lib.weeble.d

Implements:

Properties

Emoji.animated

type: readonly boolean | undefined

Indicates whether this emoji is animated.

Emoji.available

type: readonly boolean | undefined

Emoji.createdAt

type: readonly Date | null

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

Emoji.guildId

type: readonly string

Guild ID this emoji belongs to.

Emoji.id

type: readonly string | null | undefined

Emoji ID.

Emoji.managed

type: readonly boolean | undefined

Emoji.name

type: readonly string | null | undefined

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

Emoji.requireColons

type: readonly boolean | null | undefined

Emoji.roles

type: readonly string[] | null | undefined

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

Emoji.user

type: readonly 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>).