Visual indication for inline buttons

微笑、不失礼 提交于 2019-12-11 04:27:56

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/40728670/visual-indication-for-inline-buttons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!