KitDevguides

KitDev / Guides / Premium emojis

Premium emojis

KitDev uses regular emojis and, if your account has Telegram Premium, it can use custom emojis instead. They are all in a single file, kitdev/core/emoji.py:

EMOJIS = {
    "alive": ("⚡", ""),
    "uptime": ("⏱️", ""),
    "python": ("🐍", ""),
    "kurigram": ("📦", ""),
}

Each entry is name: (regular emoji, premium emoji ID). Paste the ID between the quotes, digits only. If the ID is empty, or the account doesn't have Premium, the regular emoji is used, which also serves as a fallback.

For example, to enable the premium emoji of alive:

"alive": ("⚡", "ID_NUMERICO_DEL_EMOJI"),

Restart with .restart for the change to apply.

On startup, the console says Emojis premium: activados or desactivados (la cuenta no tiene Premium).

Using them in a plugin

Import e and ask for the emoji by name. Messages with emojis are written in HTML:

# kitdev/plugins/ejemplo.py

from kitdev.core.decorators import cmd
from kitdev.core.emoji import e


@cmd("estado", "Muestra un mensaje con emoji")
async def estado(client, message):
    await message.edit_text(f"{e('alive')} <b>Todo en orden</b>")

For now .alive uses them. To add a new one, add a line to the EMOJIS dictionary with its name, and use it with e("name").

More about creating commands in Plugins and structure.