Class: EmojiManager
Extends
BaseManager<string,Emoji>
Constructors
Constructor
new EmojiManager(
client,server?,limit?):EmojiManager
Parameters
| Parameter | Type | Default value |
|---|---|---|
client | Client | undefined |
server? | Server | undefined |
limit? | number | Infinity |
Returns
EmojiManager
Overrides
BaseManager<string, Emoji>.constructor
Properties
cache
cache:
Collection<string,Emoji>
Inherited from
BaseManager.cache
client
client:
Client
Inherited from
BaseManager.client
server?
optionalserver?:Server
Methods
[custom]()
[custom]():
Collection<string,Emoji>
Returns
Collection<string, Emoji>
construct()
protectedconstruct(data):Emoji
Tell BaseManager how to build an Emoji
Parameters
| Parameter | Type |
|---|---|
data | { } |
Returns
Overrides
BaseManager.construct
crate()
crate(
options):Promise<Emoji>
Create a new emoji
Parameters
| Parameter | Type | Description |
|---|---|---|
options | EmojiCreateOptions | The options for creating the emoji |
Returns
Promise<Emoji>
A promise that resolves to the created Emoji object.
Throws
If no server is registered in the EmojiManager or if the emoji attachment cannot be resolved.
Example
const emoji = await client.emojis.create(server, { emoji: "path/to/emoji.png", name: "myEmoji" });
delete()
delete(
emoji):Promise<void>
Delete an emoji
Parameters
| Parameter | Type | Description |
|---|---|---|
emoji | EmojiResolvable | The EmojiResolvable to delete |
Returns
Promise<void>
Throws
If no server is registered in the EmojiManager.
Example
await client.emojis.delete(emoji);
edit()
edit(
emoji,options):Promise<Emoji>
Edit an emoji
Parameters
| Parameter | Type | Description |
|---|---|---|
emoji | EmojiResolvable | The EmojiResolvable to edit |
options | EmojiEditOptions | The options to edit the emoji with |
Returns
Promise<Emoji>
A promise that resolves to the edited Emoji object.
Throws
If no server is registered in the EmojiManager.
Example
const editedEmoji = await client.emojis.edit(emoji, { name: "newName" });
extractId()
protectedextractId(data):string
Tell BaseManager how to find the ID for Emojis
Parameters
| Parameter | Type |
|---|---|
data | { } |
Returns
string
Overrides
BaseManager.extractId
fetch()
fetch(
emoji,force?):Promise<Emoji>
Fetch an Emoji from the API or resolves it from the local cache.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
emoji | EmojiResolvable | undefined | The ID, mention, or Emoji object to fetch |
force | boolean | false | 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 an invalid EmojiResolvable is provided.
Throws
If the API request fails.
Example
// Fetch a channel, bypassing cache
const channel = await client.channels.fetch("01H...", true);
resolve()
resolve(
emoji):Emoji|undefined
Resolves a EmojiResolvable to a Emoji object from the cache.
Parameters
| Parameter | Type | Description |
|---|---|---|
emoji | EmojiResolvable | The EmojiResolvable to resolve. |
Returns
Emoji | undefined
The resolved Emoji object, or undefined if not found.
resolveId()
resolveId(
emoji):string
Extracts ID from a EmojiResolvable.
Parameters
| Parameter | Type | Description |
|---|---|---|
emoji | EmojiResolvable | The EmojiResolvable to extract the ID from. |
Returns
string
The extracted Emoji ID.
Throws
If an invalid type is provided.