Visual indication for inline buttons

2019-08-06 09:57发布

Is there a way to show some visual indication that the inline button has been pressed in telegram bot.

I have a bit which send inline keyboard, and when I press each buttons it works perfectly fine, but there is a slight delay in getting response from the server. As there is no visual indication to show if a button has been pressed, it is confusing for uses to know if the button was pressed and end up pressing the same button several times.

2条回答
放荡不羁爱自由
2楼-- · 2019-08-06 10:43

As an alternative way, after you got the callback response at your server, you can use Emoji for showing feedback to your users. Just edit the inline message and edit some relative emoji to the button text.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-08-06 10:45

there are different types of inline buttons in Telegram:

  • Opens URL (with url).
  • Forward a message (with switch_inline_query).
  • Insert query at the chat (with switch_inline_query_current_chat).
  • Button with action (with callback_data).

I suppose you are refering to the last type of button, in that case, if a user press a button you will get the callback_data via CallbackQuery, and that lets you modify the original message with editMessageText to add something like:

Button TEST pressed.

查看更多
登录 后发表回答