Skip to content

setCustomEmojiStickerSetThumbnail

Returns: TrueOfficial docs ↗

Use this method to set the thumbnail of a custom emoji sticker set. Returns True on success.

Parameters

nameStringRequired
Sticker set name
custom_emoji_idStringOptional
Custom emoji identifier of a sticker from the sticker set; pass an empty string to drop the thumbnail and use the first sticker as the thumbnail.

Returns

On success, True is returned.

GramIO Usage

ts
// Set a specific emoji as the sticker set thumbnail
await 
bot
.
api
.
setCustomEmojiStickerSetThumbnail
({
name
: "my_emoji_set_by_mybot",
custom_emoji_id
: "5368324170671202286",
});
ts
// Drop the thumbnail — the first sticker in the set is used automatically
await 
bot
.
api
.
setCustomEmojiStickerSetThumbnail
({
name
: "my_emoji_set_by_mybot",
custom_emoji_id
: "",
});
ts
// Update thumbnail after adding a new emoji to the set
async function 
updateStickerSetThumbnail
(
setName
: string,
thumbnailEmojiId
: string) {
await
bot
.
api
.
setCustomEmojiStickerSetThumbnail
({
name
:
setName
,
custom_emoji_id
:
thumbnailEmojiId
,
}); }

Errors

CodeErrorCause
400Bad Request: STICKERSET_INVALIDNo sticker set with this name exists, or it belongs to another bot
400Bad Request: STICKER_ID_INVALIDcustom_emoji_id does not refer to a sticker in this set — verify it belongs to the set
400Bad Request: not a custom emoji sticker setThe sticker set is a regular image/animated set, not a custom emoji set — method only works for custom emoji sets
429Too Many Requests: retry after NRate limit hit — check retry_after and back off

TIP

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

Tips & Gotchas

  • This method only works for custom emoji sticker sets. It does not apply to regular image, animated (.TGS), or video (.WEBM) sticker sets — use setStickerSetThumbnail for those.
  • Pass an empty string to clear the thumbnail. When custom_emoji_id is "", Telegram automatically uses the first sticker in the set as the display thumbnail.
  • The emoji must be part of the set. The custom_emoji_id must reference an emoji that is already in the sticker set — you cannot use an emoji from a different set.
  • Sticker set name convention. Custom emoji set names created via the bot typically end in _by_<botusername>. Use getStickerSet to look up the exact name.
  • Bot must own the sticker set. Only the bot that created the sticker set can modify its thumbnail.

See Also