fix: handle telegram: prefix in resolveTelegramTargetChatType#1072
Closed
danielz1z wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix: handle telegram: prefix in resolveTelegramTargetChatType#1072danielz1z wants to merge 1 commit intoopenclaw:mainfrom
danielz1z wants to merge 1 commit intoopenclaw:mainfrom
Conversation
When using inlineButtons="dm" or "group" scope, the validation check resolveTelegramTargetChatType() failed for numeric chat IDs because normalizeTelegramMessagingTarget() adds a "telegram:" prefix during target resolution. For example, target "5232990709" becomes "telegram:5232990709" after normalization, but the regex /^-?\d+$/ expects a pure numeric string. The fix strips the telegram: prefix before checking the numeric pattern. Adds tests for resolveTelegramTargetChatType with various input formats.
steipete
added a commit
that referenced
this pull request
Jan 17, 2026
@danielz1z Co-authored-by: danielz1z <danielz1z@users.noreply.github.com>
Contributor
|
Thanks @danielz1z! Landed on main via d63cc1e. What I did:
Tests:
|
steipete
added a commit
that referenced
this pull request
Jan 17, 2026
…nielz1z Co-authored-by: danielz1z <danielz1z@users.noreply.github.com>
Contributor
|
Added extra tests post-merge to cover tg/group/topic inline button targets. Commit: f3f8050 |
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
… — thanks @danielz1z Co-authored-by: danielz1z <danielz1z@users.noreply.github.com>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…anks @danielz1z Co-authored-by: danielz1z <danielz1z@users.noreply.github.com>
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.
When using
inlineButtons="dm"or"group"scope, the validation inresolveTelegramTargetChatType()fails for numeric chat IDs.Root cause:
normalizeTelegramMessagingTarget()adds atelegram:prefix during target resolution:"5232990709""telegram:5232990709"But
resolveTelegramTargetChatType()expects a pure numeric string and its regex/^-?\d+$/fails on the prefixed value.Error seen:
Fix: Strip the
telegram:prefix before checking the numeric pattern.Tests: Added test file for
resolveTelegramTargetChatTypecovering:telegram:xxx)