内嵌按钮的视觉指示 [英] Visual indication for inline buttons
问题描述
有没有办法在电报机器人中显示一些内嵌按钮已被按下的视觉指示.
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.
推荐答案
有不同类型的内嵌按钮:
- 打开URL(使用
url
). - 转发消息(使用
switch_inline_query
). - 在聊天中插入查询(使用
switch_inline_query_current_chat
). - 带有操作的按钮(带有
callback_data
).
- 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
).
我想您指的是最后一种类型的按钮,在这种情况下,如果用户按下按钮您将通过CallbackQuery,这让您可以使用editMessageText 添加一些内容,例如:
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:
按钮TEST被按下.
这篇关于内嵌按钮的视觉指示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!