GuildStickerManager
classe · Source
Manages API methods for Guild Stickers and stores their cache.
Extends: CachedManager
Properties
guild
The guild this manager belongs to Source
cache
The cache of Guild Stickers Source
_cache
The private cache of items for this manager. Source
holds
The data structure belonging to this manager. Source
client
The client that instantiated this Manager Source
Methods
create
Creates a new custom sticker in the guild. Parameters
| Name | Type | Description |
|---|---|---|
file | BufferResolvable | Stream | FileOptions | MessageAttachment | The file for the sticker |
name | string | The name for the sticker |
tags | string | The Discord name of a unicode emoji representing the sticker's expression |
options? | GuildStickerCreateOptions | Options |
Returns: Promise<Sticker> — The created sticker
// Create a new sticker from a URL
guild.stickers.create('https://i.imgur.com/w3duR07.png', 'rip', 'headstone')
.then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))
.catch(console.error);// Create a new sticker from a file on your computer
guild.stickers.create('./memes/banana.png', 'banana', 'banana')
.then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))
.catch(console.error);resolve
Resolves a StickerResolvable to a Sticker object. Parameters
| Name | Type | Description |
|---|---|---|
sticker | StickerResolvable | The Sticker resolvable to identify |
Returns: StickerSource
resolveId
Resolves a StickerResolvable to a Sticker id string. Parameters
| Name | Type | Description |
|---|---|---|
sticker | StickerResolvable | The Sticker resolvable to identify |
Returns: SnowflakeSource
edit
Edits a sticker. Parameters
| Name | Type | Description |
|---|---|---|
sticker | StickerResolvable | The sticker to edit |
data? | GuildStickerEditData | The new data for the sticker |
reason? | string | Reason for editing this sticker |
Returns: Promise<Sticker>Source
delete
Deletes a sticker. Parameters
| Name | Type | Description |
|---|---|---|
sticker | StickerResolvable | The sticker to delete |
reason? | string | Reason for deleting this sticker |
Returns: Promise<void>Source
fetch
Obtains one or more stickers from Discord, or the sticker cache if they're already available. Parameters
| Name | Type | Description |
|---|---|---|
id? | Snowflake | The Sticker's id |
options? | BaseFetchOptions | Additional options for this fetch |
Returns: Promise<(Sticker\|Collection<Snowflake, Sticker>)>
// Fetch all stickers from the guild
message.guild.stickers.fetch()
.then(stickers => console.log(`There are ${stickers.size} stickers.`))
.catch(console.error);// Fetch a single sticker
message.guild.stickers.fetch('222078108977594368')
.then(sticker => console.log(`The sticker name is: ${sticker.name}`))
.catch(console.error);fetchUser
Fetches the user who uploaded this sticker, if this is a guild sticker. Parameters
| Name | Type | Description |
|---|---|---|
sticker | StickerResolvable | The sticker to fetch the user for |
Returns: Promise<?User>Source