Skip to content

StickerManager

StickerManager ⇐ Base

Represents a Sticker Manager that handles operations related to stickers in a guild.

Kind: global class
Extends: Base

new StickerManager(client)

Constructs a new instance of the class.

ParamTypeDescription
clientClientThe client object used for communication with the server.

stickerManager.cache ⇒

Getter method for the cache property.

Kind: instance property of StickerManager
Returns: The Collection object representing the cache.

stickerManager._add(stickers, [guildId], [options]) ⇒ Sticker | null

Adds a sticker to the cache and returns the sticker object.

Kind: instance method of StickerManager
Returns: Sticker | null - The sticker object that was added to the cache

ParamTypeDefaultDescription
stickersstring | StickerThe sticker object or sticker ID to add to the cache.
[guildId]string”this.guildId”The ID of the guild where the sticker belongs.
[options]object{cache: true, force: false}Additional options for adding the sticker.
[options.cache]booleantrueWhether to cache the sticker object.
[options.force]booleanfalseWhether to force fetching the sticker even if it is already in the cache.

stickerManager.fetch(sticker, [options]) ⇒ Promise.<Sticker>

Fetches a sticker from the server based on the provided sticker ID or options.

Kind: instance method of StickerManager
Returns: Promise.<Sticker> - - A promise that resolves to the fetched sticker.

ParamTypeDefaultDescription
stickerstring | objectThe sticker ID or options object.
[options]objectThe options for fetching the sticker.
[options.cache]booleantrueWhether to cache the fetched sticker.
[options.force]booleanfalseWhether to force fetch the sticker even if it is already cached.

stickerManager._fetchId(sticker, [cache], [force]) ⇒ Promise.<Sticker>

Fetches the ID of a sticker from the server.

Kind: instance method of StickerManager
Returns: Promise.<Sticker> - - A promise that resolves with the fetched sticker.

ParamTypeDefaultDescription
stickerstring | StickerThe sticker or sticker ID to fetch.
[cache]booleantrueWhether to cache the fetched sticker.
[force]booleanfalseWhether to force fetching the sticker even if it is already cached.

stickerManager.create([options]) ⇒ Promise.<Sticker>

Creates a sticker in the guild.

Kind: instance method of StickerManager
Returns: Promise.<Sticker> - A promise that resolves with the created sticker.

ParamTypeDescription
[options]ObjectThe options for creating the sticker.
[options.reason]stringThe reason for creating the sticker.

stickerManager.edit(sticker, [options]) ⇒ Promise.<Sticker>

Edits a sticker with the given options.

Kind: instance method of StickerManager
Returns: Promise.<Sticker> - A promise that resolves with the edited sticker.

ParamTypeDescription
stickerstring | StickerThe sticker to edit. Can be either a sticker ID or a sticker object.
[options]ObjectThe options for editing the sticker.
[options.reason]stringThe reason for editing the sticker.

stickerManager.delete(sticker, reason) ⇒ Promise.<Sticker>

Deletes a sticker from the guild.

Kind: instance method of StickerManager
Returns: Promise.<Sticker> - - The deleted sticker object.
Throws:

  • Error - If the sticker deletion fails.
ParamTypeDescription
stickerstring | StickerThe sticker to delete. Can be either a sticker ID or a sticker object.
reasonstringThe reason for deleting the sticker.