Skip to content

setStickerEmojiList

Returns: TrueOfficial docs ↗

Use this method to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot. Returns True on success.

Parameters

stickerStringRequired
File identifier of the sticker
emoji_listString[]Required
A JSON-serialized list of 1-20 emoji associated with the sticker

Returns

On success, True is returned.

GramIO Usage

ts
// Assign emoji to a sticker by its file_id
await 
bot
.
api
.
setStickerEmojiList
({
sticker
: "CAACAgIAAxkBAAIBcWZ...",
emoji_list
: ["😄", "😂", "🤣"],
});
ts
// Replace emoji on a sticker — set exactly one primary emoji
await 
bot
.
api
.
setStickerEmojiList
({
sticker
: "CAACAgIAAxkBAAIBcWZ...",
emoji_list
: ["🔥"],
});
ts
// Get a sticker set to find file_ids, then update emoji on each sticker
const 
set
= await
bot
.
api
.
getStickerSet
({
name
: "my_pack_by_mybot" });
for (const
sticker
of
set
.
stickers
) {
// Only update stickers that don't already have the right emoji if (!
sticker
.
emoji
?.
includes
("⭐")) {
await
bot
.
api
.
setStickerEmojiList
({
sticker
:
sticker
.
file_id
,
emoji_list
: [
sticker
.
emoji
?? "⭐", "⭐"],
}); } }

Errors

CodeErrorCause
400Bad Request: STICKER_ID_INVALIDThe sticker file_id is invalid or the sticker doesn't belong to a set created by this bot
400Bad Request: emoji list must be non-emptyemoji_list is empty — provide at least 1 emoji
400Bad Request: emoji list is too longemoji_list has more than 20 entries — trim the list
400Bad Request: can't use this stickerThe sticker type doesn't support emoji lists (e.g., mask stickers)
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

  • Only works on stickers in bot-created sets. You can only modify emoji for stickers in sets your bot created — attempting to modify stickers in sets owned by other bots or users returns an error.
  • 1–20 emoji, not characters. The limit counts emoji, not bytes or code points. Multi-codepoint emoji (like 🏳️‍🌈) count as one emoji. Stay within 1–20 entries.
  • The first emoji is the "primary" one. Telegram displays the first emoji in the list as the sticker's main associated emoji in the sticker picker. Put the most relevant emoji first.
  • Use the sticker's file_id, not file_unique_id. The file_id is what you pass to sticker management methods — get it from getStickerSet or from a received sticker message.
  • Works for both regular and custom emoji stickers. Both sticker types support emoji lists, but mask stickers do not.

See Also