O
O
okovalev2020-08-03 02:53:22
Telegram
okovalev, 2020-08-03 02:53:22

sendMessage method. How to send a keyboard that, when one button is clicked, sends a great message?

https://core.telegram.org/bots/api#sendmessage

There is a reply_markup where you can send a keyboard.
I want that when sending ReplyKeyboardMarkup one thing is written, and another message is sent. 5f2751b0cceb7255952005.png
In other words, I want to click on the stars, and what would go 5 for example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2020-08-03
@okovalev

If I understood you correctly, then you want to send numbers from 1 to 5 when clicking on the stars, depending on which star is clicked on?
if yes, then in the form in which you want to get it on ReplyKeyboardMarkup, this cannot be done in principle,
but for InlineKeyboardMarkup, this option is possible - make the last line 5 buttons with asterisks, setting a number from 1 to 5 through CallBackData for each of the asterisks, which and will be sent to the bot when the button is clicked.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question