Telegram: Bot API ingress channel (closes #39) - #48
Merged
Conversation
6 tasks
lezama
marked this pull request as ready for review
May 18, 2026 11:21
lezama
force-pushed
the
ship/issue-39-telegram
branch
from
May 18, 2026 11:22
4fa51a2 to
d07d7e3
Compare
lezama
force-pushed
the
ship/issue-39-telegram
branch
from
May 18, 2026 11:25
d07d7e3 to
8d88f40
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #39
Summary
Adds Telegram as a second inbound channel alongside WhatsApp. v1 is text-only; mirrors the WhatsApp module almost line-for-line so the multi-channel architecture stays consistent.
OpenclaWP_Telegramclass: REST webhook + outboundsendMessage+ admin page at openclaWP → Telegram, plus a card on the Channels list.X-Telegram-Bot-Api-Secret-Token(constant-time compare, fails closed when secret or header is empty).*opens it up for dev). Drop counter surfaced on the admin page as a notice.openclawp_register_telegramfilter.setWebhookwith our URL + secret_token.reply_to_message_idwhen an inbound message_id is present.wp_remote_postonly.Test plan
vendor/bin/phpunit --testsuite unit— 46 tests, 70 assertions (16 new inTelegramWebhookTest)npm run lint— cleanphp -lon every changed file — no syntax errorsphp tests/smoke.phpinside Studio — exercises the webhook handler end-to-end for the three required scenarios (HMAC mismatch → 401, allowlisted chat → 200+processed, unauthorized chat → 200+dropped)docs/telegram-setup.mdWhat deferred (per issue v1 scope)
telegram_unsupported_type.Quality gate results
php -l)vendor/bin/phpunit --testsuite unitnpm run lint