Skip to content

deleteStickerSet

Returns: TrueOfficial docs ↗

Use this method to delete a sticker set that was created by the bot. Returns True on success.

Parameters

nameStringRequired
Sticker set name

Returns

On success, True is returned.

GramIO Usage

ts
// Delete a sticker set by its name
await 
bot
.
api
.
deleteStickerSet
({
name
: "my_pack_by_mybot",
});
ts
// Delete a sticker set after confirming it exists
const 
stickerSet
= await
bot
.
api
.
getStickerSet
({
name
: "my_pack_by_mybot" });
if (
stickerSet
) {
await
bot
.
api
.
deleteStickerSet
({
name
:
stickerSet
.
name
});
console
.
log
(`Deleted sticker set: ${
stickerSet
.
title
}`);
}
ts
// Clean up multiple sticker sets created by the bot
const 
stickerSetNames
= ["pack_one_by_mybot", "pack_two_by_mybot", "pack_three_by_mybot"];
for (const
name
of
stickerSetNames
) {
await
bot
.
api
.
deleteStickerSet
({
name
});
}

Errors

CodeErrorCause
400Bad Request: STICKERSET_INVALIDThe sticker set name doesn't exist or was not created by this bot
400Bad Request: not enough rightsThe bot does not own the sticker set — only the creating bot can delete a set
429Too Many Requests: retry after NRate limit hit — check retry_after, use auto-retry plugin

TIP

Use GramIO's auto-retry plugin to handle 429 errors automatically.

Tips & Gotchas

  • Name format is <set_name>_by_<botusername>. Sticker set names always end with _by_<botusername> where <botusername> is your bot's username without the @. This suffix is appended automatically by Telegram when you create the set, but you must include it when referencing the set name.
  • Only the creating bot can delete the set. Sticker sets are owned per-bot. A different bot token cannot delete a set even if the sets are managed by the same developer.
  • Deletion is permanent and irreversible. Once a sticker set is deleted, all its stickers are gone. Users who have added the pack will lose access to it. There is no way to undo this.
  • Empty sets can still be deleted. Unlike some platforms, Telegram allows deleting an empty sticker set. You do not need to remove individual stickers first.
  • Use deleteStickerFromSet to remove individual stickers. If you only want to clean up a few stickers while keeping the set alive, prefer deleteStickerFromSet over deleting the whole set.

See Also