answer_callback_query
Acknowledge a Telegram callback button press to stop its loading spinner and optionally display a text message, alert, or open a URL; invoke immediately after receiving the callback query.
Instructions
Acknowledge a callback button press so the loading spinner on the button stops.
對使用者點擊的行內按鈕回應,關閉按鈕上的載入動畫;text 可顯示小提示。
callback_query_id 來自 get_updates / wait_for_reply 的 callback_query 事件。
url 傳入時以開啟網址取代 text 提示(須為 http/https 開頭),
並與 text 互斥(兩者不可同時傳入);cache_time 為結果快取秒數
(0-604800),預設 0。
show_alert=True 時必須帶 text,否則回傳錯誤。
注意:callback_query 只有數秒有效,get_updates / wait_for_reply 回傳後
應立刻呼叫本工具;輪詢架構下若間隔過長會收到 query is too old,
建議搭配 wait_for_reply 的長輪詢,或背景常駐輪詢並立即應答。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"callback_query_id": "<callback_query_id>"
},
"name": "answer_callback_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| text | No | ||
| cache_time | No | ||
| show_alert | No | ||
| callback_query_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |