Tell me how to sew in the link additional parameters?

There is a StoreBot to evaluate Telegram bots. If you write the answer to the user:

go to @StoreBot

then the bot will be lit as a link, but the link is just to the bot https://telegram.me/storebot .

I also need a transition to the bot with the definition of what bot I will rate https://telegram.me/storebot?start=***_bot .

ps: html-tags telegram does not understand. If you write <a href="">@StoreBot</a> , it will display it with a tag.

  • one
    found. There are sendMessage ['parse_mode'] parameters in which the format (Markdown, html) of the message output is indicated! - Nikolay

1 answer 1

As you have already defined, there are Formatting options in the API. It works about the same as here on SO .

In addition to this method, there are two more options for solving your problem:

  • instead of the name of the bot @StoreBot just specify the link
  • use the built-in keyboard with a single button, when clicked, the user will be sent where necessary

If with the first option everything is extremely clear, then with the second one it is a bit more complicated. The built-in keyboard, or InlineKeyboardMarkup , is buttons that are attached directly to the message, unlike the usual ReplyKeyboardMarkup . InlineKeyboardMarkup consists of an array of buttons InlineKeyboardButton , which have a url property, having set which, we define the behavior of the button when it is clicked - click on the specified link. This solution looks very elegant.

In order to display the built-in keyboard, it is necessary to transmit it in a message to the user.