Class: Emoji
The base class for all structures.
Extends
Constructors
Constructor
new Emoji(
client,data):Emoji
Parameters
| Parameter | Type |
|---|---|
client | Client |
data | { } |
Returns
Emoji
Overrides
Properties
animated
animated:
boolean=false
cachedAt
cachedAt:
number
Inherited from
client
protectedreadonlyclient:Client
Inherited from
createdAt
createdAt:
Date
createdTimestamp
createdTimestamp:
number
creatorId
creatorId:
string
id
readonlyid:string
Inherited from
name
name:
string
nsfw
nsfw:
boolean=false
parent
parent:
EmojiParent
Methods
_clone()
_clone():
this
Helper to quickly clone a structure
Returns
this
Inherited from
_patch()
_patch(
data):void
Parameters
| Parameter | Type |
|---|---|
data | { } |
Returns
void
delete()
delete():
Promise<void>
Deletes this emoji from the server.
Returns
Promise<void>
A promise that resolves when the emoji has been deleted.
Throws
If the API request fails or if the emoji is detached.
Example
// Delete an emoji from the server
await emoji.delete();
edit()
edit(
options):Promise<Emoji>
Edits this emoji's properties.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | EmojiEditOptions | The options to edit the emoji with. |
Returns
Promise<Emoji>
A promise that resolves to the edited Emoji object.
Throws
If the API request fails or if the emoji is detached.
Example
// Edit an emoji's name
await emoji.edit({ name: "new_name" });
equals()
equals(
other):boolean
Compares this object with another to see if they represent the same entity.
Parameters
| Parameter | Type |
|---|---|
other | string | Base |
Returns
boolean
Inherited from
fetch()
fetch(
force?):Promise<Emoji>
Fetch this emoji from the API or resolves it from the local cache.
Parameters
| Parameter | Type | Description |
|---|---|---|
force? | boolean | Whether to skip the cache check and force a direct API request. Defaults to false. |
Returns
Promise<Emoji>
A promise that resolves to the fetched Emoji object.
Throws
If the API request fails or if the emoji is detached.
Example
// Force fetch emoji to update its data
await emoji.fetch(true);
toString()
toString():
string
Returns the UUID string when the object is cast to a string.
Returns
string