Siri matching for non-Telegram Contacts with open chat and iOS Contact using peer id URL - bots allowed if all conditions met#2021
Open
huntharo wants to merge 2 commits intoTelegramMessenger:masterfrom
Conversation
2 tasks
scutuatua-crypto
approved these changes
Feb 18, 2026
scutuatua-crypto
approved these changes
Feb 19, 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
Fixes #1960: allow Siri recipient resolution for Telegram bots (which cannot be Telegram contacts) by matching an iOS Contact URL that encodes the bot peer id.
What Changed
CloudUserpeers in the root chat list.How To Use / Verify
:).Cookie).add url.homepageto custom labelTelegram(case-sensitive).https://t.me/@id<bot_id>(example:https://t.me/@id12345678).Siri, message Cookie on TelegramExpected: Telegram opens with the correct bot target.
Siri, message CookieExpected: also resolves correctly when the contact has no competing phone/contact data.
Siri, message CookieExpected: resolves correctly and sends the message
Security Concerns
Bots do not appear to be eligible to be saved as contacts in Telegram. This means we cannot signal that we want to be able to address a bot (e.g. an OpenClaw bot private to the user) by saving them as a Contact in Telegram.
Allowing arbitrary matches with any open bot conversation, or matching by
@usernamebot, would be risky as it could lead to bots stealing conversations meant for other users, simply by changing their name or by a bot getting deleted and recreated by another owner with the same username.Creating an iOS Contact with a Peer ID-specific URL is an intentional act that is a strong indication that the user wants to talk to this bot. This also gives it a name that will be stable that is outside of control of the bot or any other user on Telegram.