Idle Developeridledeveloper.tech

Note

How to find a Telegram custom emoji ID

A custom emoji ID is a long decimal string, 19 digits in this directory. Telegram calls it custom_emoji_id. You need it when a bot sends a message entity of type custom_emoji, or when you write a <tg-emoji emoji-id="..."> tag. The Telegram app does not always show that string, especially if you do not have Premium.

Keep the ID in quotes. Every value here is larger than Number.MAX_SAFE_INTEGER (9007199254740991). If a JSON parser turns it into a JavaScript number, most of these IDs change and the API will not recognize them.

Use the directory

The emoji directory lists 2,079 IDs copied from public packs. Search by the fallback emoji, a short name, a pack name, or the digits themselves. Country flags also have their own pages, for example Nigeria.

Each ID page has copy buttons and ready snippets. The ID is in the HTML of the page, not only in a script.

If the emoji you want is not listed, the directory is not complete. It is the packs that were in the source files, not every custom emoji on Telegram.

Dump a pack with a bot token

Premium is not required to read a pack through the Bot API. getStickerSet takes the pack name and returns the stickers. For a custom emoji sticker, the field you want is custom_emoji_id.

The pack name is the last piece of a link like https://t.me/addemoji/RestrictedEmoji. That name is RestrictedEmoji.

The guide includes a short Python script, fetch_pack.py, that calls getStickerSet with the standard library. Set BOT_TOKEN to a normal token from BotFather and run:

python3 fetch_pack.py RestrictedEmoji

The script prints JSON. Each item has id, emoji, and pack. It skips normal stickers that have no custom_emoji_id.

Look up IDs you already have

getCustomEmojiStickers takes a list of IDs and returns sticker objects. The docs cap that list at 200 IDs per call. Use it to check that an ID from a blog post or a screenshot still exists. Pass the IDs as strings.

{
  "custom_emoji_ids": ["5206607081334906820"]
}

That example is the checkmark in the NewsEmoji pack. Its page is here.

What you still cannot skip

Finding the ID is the easy half. Sending it is limited. The Bot API says custom emoji entities can only be used by bots that purchased additional usernames on Fragment, or in messages the bot sends directly to private chats, groups, and supergroups if the owner of the bot has Telegram Premium. The guide quotes that rule and shows the entity fields.

The emoji FAQ covers the string-versus-number issue and the difference between this directory and the flags list.