A professional, stateless utility bot designed for developers to easily extract the custom_emoji_id from any Telegram Premium custom emoji. This tool is essential for building bots that can send or react with custom emojis programmatically.
- Universal Extraction: Works with any custom emoji from any pack.
- Developer-Focused Output: Provides the
custom_emoji_idand a ready-to-use code snippet. - Privacy by Design: Completely stateless. No database, no file storage, and no message logging.
- Robust Handling: Correctly parses custom emojis from both text messages and media captions.
- Clean & Modern Code: Built with
python-telegram-botv20+ using modernasync/awaitsyntax.
The Telegram Bot API allows bots to send custom emojis, but doing so requires knowing the emoji's unique custom_emoji_id. This ID is not easily accessible through the standard Telegram clients. This bot solves that problem by providing a simple interface to retrieve this ID for any custom emoji you send it.
- Python 3.8+
- A Telegram Bot Token (get one from @BotFather)
-
Clone the repository:
git clone https://github.com/S0N59/Telegram-Emoji-ID.git cd Telegram-Emoji-ID -
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure your bot token: Copy the example environment file and add your bot token.
cp .env.example .env
Now, open the
.envfile and paste yourBOT_TOKEN.
-
Run the bot:
python3 main.py
The bot will start polling for updates and print a confirmation message to your console.
-
Interact with the bot on Telegram:
- Find your bot on Telegram and send
/startto see the welcome message. - Send any message containing one or more Custom Emojis. (Note: You need a Telegram Premium subscription to send custom emojis).
- The bot will instantly reply with the
custom_emoji_idfor each emoji found.
- Find your bot on Telegram and send
User sends:
Check out this cool emoji!
Bot replies:
Custom Emojis Detected:
Developer Note: To use this ID in your bot code, pass it to the
custom_emoji_idparameter when sending a message entity of typecustom_emoji.
Here is a practical example of how you would use the extracted ID in your own python-telegram-bot code to send a custom emoji:
from telegram import Update, MessageEntity
from telegram.ext import ContextTypes
async def send_custom_emoji(update: Update, context: ContextTypes.DEFAULT_TYPE):
text = "Look at this custom emoji! -> "
# The custom_emoji_id you extracted from this bot
emoji_id = "1234567890123456789"
# The entity that represents the custom emoji in the text
entity = MessageEntity(
type="custom_emoji",
offset=len(text),
length=2, # Length of the emoji character(s)
custom_emoji_id=emoji_id
)
# The placeholder character(s) for the emoji in the text
text_with_placeholder = text + "😎" # Use the actual emoji character if known
await context.bot.send_message(
chat_id=update.effective_chat.id,
text=text_with_placeholder,
entities=[entity]
)This project is licensed under the MIT License. See the LICENSE file for details.
