getForumTopicIconStickers
Returns: Sticker[]Official docs ↗
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
| Code | Error | Cause |
|---|---|---|
| 429 | Too Many Requests: retry after N | Rate 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— notfile_id. When passing an icon tocreateForumTopicoreditForumTopic, use thecustom_emoji_idfield from the sticker, notfile_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. CallingcreateForumTopicon a regular group or non-forum supergroup will fail.
See Also
- Sticker — return type element
- createForumTopic — create a new forum topic using an icon from this list
- editForumTopic — change the icon of an existing topic