MCPcopy Create free account
hub / github.com/cvzi/telegram-bot-cloudflare / answerCallbackQuery

Function answerCallbackQuery

bot2.js:162–170  ·  view source on GitHub ↗

* Answer callback query (inline button press) * This stops the loading indicator on the button and optionally shows a message * https://core.telegram.org/bots/api#answercallbackquery

(callbackQueryId, text = null)

Source from the content-addressed store, hash-verified

160 * https://core.telegram.org/bots/api#answercallbackquery
161 */
162async function answerCallbackQuery (callbackQueryId, text = null) {
163 const data = {
164 callback_query_id: callbackQueryId
165 }
166 if (text) {
167 data.text = text
168 }
169 return (await fetch(apiUrl('answerCallbackQuery', data))).json()
170}
171
172/**
173 * Handle incoming callback_query (inline button press)

Callers 1

onCallbackQueryFunction · 0.85

Calls 2

fetchFunction · 0.85
apiUrlFunction · 0.70

Tested by

no test coverage detected