feat(telegram): add Business mode support - #888
Merged
Conversation
Contributor
|
@psychometdev is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
Handle business_connection, business_message, and pass business_connection_id on outbound API calls. Closes vercel#887 Signed-off-by: Psychomet <psychomet.dev@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve customer userId for allowedUserIds on business_message updates. Omit business_connection_id from deleteMessage and setMessageReaction. Signed-off-by: Psychomet <psychomet.dev@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
… to end Business threads are now their own channel, so channel posts keep business_connection_id and locks and history stay separate from the customer's direct bot chat. Callback queries, slash commands, and media groups in business chats resolve to the business thread. Deletes go through deleteBusinessMessages. Reactions throw a NotImplementedError since the Bot API has no business variant. fetchThread carries the connection id and falls back to cached chat details when getChat cannot resolve the customer. Connection state moves from a per-instance Map into the state adapter with a TTL, and is recorded before the allowedUserIds gate so rights changes always land. Outgoing echoes carrying sender_business_bot are skipped and attributed to the bot. Polling always sends an explicit allowed_updates list in Business mode.
Cover channel separation, slash commands, deletes via deleteBusinessMessages, the reaction limitation, polling allowed_updates, and the telegram:biz sharding caveat.
Split the business fixture into separate connection, customer message, bot-sent echo, and edited message updates. Document the telegram:biz thread format and business update routing in AGENTS.md.
bensabic
force-pushed
the
feat/telegram-business-mode
branch
from
September 4, 2026 03:51
851a11d to
4ba410d
Compare
bensabic
enabled auto-merge (squash)
September 4, 2026 03:57
bensabic
approved these changes
Sep 4, 2026
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.
Summary
@chat-adapter/telegrambusiness_connection,business_message, andedited_business_messageupdatesbusiness_connection_idon outbound sends, edits, typing, and file uploadsbusinessMode: true(default off, backward compatible)Closes #887
Test plan
pnpm --filter @chat-adapter/telegram test— business mode suite)businessMode: false