If you want a last-resort text response, add a general text handler after your command and pattern-specific handlers.
bot.on('text', async (ctx) => {
await ctx.reply("Sorry, I didn't understand that. Type /help for available commands.");
});
Place broad text fallbacks near the end of your handler setup. If they come too early, more specific text handlers may never run.
Coloured buttons
Bot API 9.4 introduced a style field on InlineKeyboardButton. When the bot owner has a supported client version, buttons render with a solid background colour instead of the default transparent style.
Value
Colour
When to use
"primary"
Dark blue
Main action — confirm, submit, proceed
"success"
Green
Positive outcome — paid, verified, done
"danger"
Red
Destructive action — delete, ban, cancel
Pass style directly inside the button object. Telegraf forwards unknown fields to the API as-is, so no extra setup is needed:
Older Telegram clients silently ignore style and display the button without any colour. No fallback handling is needed on your side.
Premium emojis
Telegram now allows bots to send animated premium custom emojis in messages — but only if the bot's owner has an active Telegram Premium subscription. If the owner does not have Premium, the emoji will fall back to the placeholder text inside the tag.
Use HTML parse mode and the <tg-emoji emoji-id="..."> tag, passing the custom emoji ID from Telegram's sticker set:
You can find custom emoji IDs by forwarding a message containing the emoji to @bot_info_bot or by calling the getCustomEmojiStickers Bot API method with the emoji ID.
The bot owner's Premium status is checked server-side by Telegram. You do not need to pass any extra flag — just send the tag with a valid premium emoji ID and Telegram handles the rest.