GuildStickerManager

export class GuildStickerManager extends CachedManager<Snowflake, Sticker, StickerResolvable>
export class GuildStickerManager extends CachedManager<Snowflake, Sticker, StickerResolvable>
Manages API methods for Guild Stickers and stores their cache.
Readonly
cache:Collection<Key, Holds>
The cache of items for this manager.
Inherited from DataManager
Readonly
client:Client
The client that instantiated this Manager
Inherited from BaseManager
guild:Guild
The guild this manager belongs to
Readonly
holds:Constructable<Holds>
The data structure belonging to this manager.
Inherited from DataManager
create(options):Promise<Sticker>
Creates a new custom sticker in the guild.
Returns
The created sticker
Example
// Create a new sticker from a URL
guild.stickers.create({ file: 'https://i.imgur.com/w3duR07.png', name: 'rip', tags: 'headstone' })
.then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))
.catch(console.error);
// Create a new sticker from a URL
guild.stickers.create({ file: 'https://i.imgur.com/w3duR07.png', name: 'rip', tags: 'headstone' })
.then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))
.catch(console.error);
Example
// Create a new sticker from a file on your computer
guild.stickers.create({ file: './memes/banana.png', name: 'banana', tags: 'banana' })
.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({ file: './memes/banana.png', name: 'banana', tags: 'banana' })
.then(sticker => console.log(`Created new sticker with name ${sticker.name}!`))
.catch(console.error);
NameTypeOptionalDescription
optionsGuildStickerCreateOptionsNoOptions for creating a guild sticker
delete(sticker, reason?):Promise<void>
Deletes a sticker.
NameTypeOptionalDescription
stickerStickerResolvableNoThe sticker to delete
reasonstringYesReason for deleting this sticker
edit(sticker, options?):Promise<Sticker>
Edits a sticker.
NameTypeOptionalDescription
stickerStickerResolvableNoThe sticker to edit
optionsGuildStickerEditOptionsYesThe new data for the sticker
fetch(id, options?):Promise<Sticker>
Obtains one or more stickers from Discord, or the sticker cache if they're already available.
Example
// Fetch all stickers from the guild
message.guild.stickers.fetch()
.then(stickers => console.log(`There are ${stickers.size} stickers.`))
.catch(console.error);
// Fetch all stickers from the guild
message.guild.stickers.fetch()
.then(stickers => console.log(`There are ${stickers.size} stickers.`))
.catch(console.error);
Example
// Fetch a single sticker
message.guild.stickers.fetch('222078108977594368')
.then(sticker => console.log(`The sticker name is: ${sticker.name}`))
.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);
NameTypeOptionalDescription
idSnowflakeNoThe Sticker's id
optionsBaseFetchOptionsYesAdditional options for this fetch
fetchUser(sticker):Promise<User | null>
Fetches the user who uploaded this sticker, if this is a guild sticker.
NameTypeOptionalDescription
stickerStickerResolvableNoThe sticker to fetch the user for
resolve(sticker):Sticker | null
Resolves a StickerResolvable to a Sticker object.
NameTypeOptionalDescription
stickerStickerResolvableNoThe Sticker resolvable to identify
resolveId(sticker):Snowflake | null
Resolves a StickerResolvable to a Sticker id string.
NameTypeOptionalDescription
stickerStickerResolvableNoThe Sticker resolvable to identify
valueOf():Collection<Key, Holds>