Skip to content

Answer callback queries for incoming webhook Telegram bots - #91

Closed
mysubcult wants to merge 1 commit into
LiveHelperChat:masterfrom
mysubcult:fix/answer-callback-query-webhook
Closed

mysubcult wants to merge 1 commit into
LiveHelperChat:masterfrom
mysubcult:fix/answer-callback-query-webhook

Conversation

@mysubcult

Copy link
Copy Markdown
Contributor

When a Telegram bot is connected through an incoming webhook (/webhooks/incoming/...?telegram_bot_id=N), inline button clicks reach LHC as callback_query and are processed by the bot, but answerCallbackQuery is never called. Telegram keeps the pressed button in a loading state until its own timeout, so the bot looks frozen even though it already replied.

The legacy /telegram/callback/N flow (CallbackqueryCommand) already answers callback queries; only the incoming webhook flow was missing it.

Change

  • Listen to chat.webhook_incoming in the extension bootstrap.
  • For telegram scope webhooks with callback_query.id and telegram_bot_id, call answerCallbackQuery immediately with a short curl timeout (2 s connect / 3 s total), so webhook processing is not delayed.

Testing

Deployed on our production instance with an incoming-webhook Telegram bot and bot trigger quick replies (inline buttons).

🤖 Generated with Claude Code

When a Telegram bot is connected through an incoming webhook
(?telegram_bot_id=), inline button clicks are passed to the bot as
callback_query, but answerCallbackQuery is never called. Telegram then
keeps the button in a loading state until it times out.

Listen to chat.webhook_incoming and answer the callback query right away
with a short curl timeout so webhook processing is not delayed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@remdex

remdex commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Won't accept that can be done via bot builder itself.

@remdex remdex closed this Oct 12, 2026
@mysubcult
mysubcult deleted the fix/answer-callback-query-webhook branch October 26, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants