Skip to content

getForumTopicIconStickers

Use this method to get custom emoji stickers, which can be used as a forum topic icon by any user. Requires no parameters. Returns an Array of Sticker objects.

Returns

On success, an array of Sticker objects is returned.

GramIO Usage

ts
// Fetch all stickers available as forum topic icons
const 
stickers
= await
bot
.
api
.
getForumTopicIconStickers
();
console
.
log
(`${
stickers
.
length
} icon stickers available`);
ts
// Use an icon sticker when creating a forum topic
const 
stickers
= await
bot
.
api
.
getForumTopicIconStickers
();
const
icon
=
stickers
[0]; // pick any from the list
if (
icon
.
custom_emoji_id
) {
await
bot
.
api
.
createForumTopic
({
chat_id
: -1001234567890,
name
: "Support",
icon_custom_emoji_id
:
icon
.
custom_emoji_id
,
}); }
ts
// Find a specific icon by emoji character
const 
stickers
= await
bot
.
api
.
getForumTopicIconStickers
();
const
heartIcon
=
stickers
.
find
((
s
) =>
s
.
emoji
=== "❤️");
const
heartEmojiId
=
heartIcon
?.
custom_emoji_id
;
if (
heartEmojiId
) {
await
bot
.
api
.
createForumTopic
({
chat_id
: -1001234567890,
name
: "Love & Support",
icon_color
: 0xFB6F5F,
icon_custom_emoji_id
:
heartEmojiId
,
}); }
ts
// List available icons and their emojis
const 
stickers
= await
bot
.
api
.
getForumTopicIconStickers
();
const
icons
=
stickers
.
filter
((
s
) =>
s
.
custom_emoji_id
)
.
map
((
s
) => ({
emoji
:
s
.
emoji
,
id
:
s
.
custom_emoji_id
}));
console
.
log
(
icons
);

Errors

CodeErrorCause
429Too Many Requests: retry after NRate limit hit — check retry_after, use the auto-retry plugin

TIP

This method requires no permissions and almost never fails. The result is stable over time — you can cache it at startup rather than calling it on every topic creation.

Tips & Gotchas

  • No parameters required. This method takes no input — call it as bot.api.getForumTopicIconStickers() with no arguments.
  • Result is stable, cache it. The set of valid forum icon stickers changes infrequently. Fetch once at startup and reuse the list throughout your bot's lifetime.
  • Use custom_emoji_id — not file_id. When passing an icon to createForumTopic or editForumTopic, use the custom_emoji_id field from the sticker, not file_id.
  • Available to all users, not just bots. Any Telegram user can use these stickers as topic icons — the list is the same globally, not per-bot.
  • Forum topics require a supergroup with is_forum: true. Calling createForumTopic on a regular group or non-forum supergroup will fail.

See Also