Search code examples
telegramtelegram-bot

How to get callback by text hyperlink in Telegram bot?


I have a telegram bot with command /list, that show list of something, for example:

There are some list:

Alex

Ivan

Pier

I want to make names clickable, and show detailed information on click. But how I can get callback on that action with telegram api? I don't want to use buttons.


Solution

  • There are several ways to navigate in the Telegram bot:

    1. Buttons (the easiest). Canonical way for any action, when user already in bot. Here is how to use inline keyboard buttons API.
    2. Deep links (seems like an answer). Usually it is used to navigate user from the outside to your Telegram bot concrete action https://t.me/yourAwesomeBot?start=concrete_action, read more
    3. Telegram Web App (outstanding). Just build an a fully-fledge Web App inside your bot an make your fancy dreams come true, read more