如何打开预加载文本消息的指定Telegram账号?相关链接有效性咨询
如何打开预加载文本消息的指定Telegram账号?
Hey there! Let's walk through this step by step—this is a super common use case with Telegram's built-in deep linking system, and your proposed links are actually spot-on.
核心实现逻辑
Telegram supports deep links that let you directly open a chat with a specific user/bot and pre-fill a message for the user to send. This works seamlessly across desktop, mobile apps, and the Telegram web interface.
你提供的两种链接是否有效?
Absolutely! Both formats are officially supported, just tailored for slightly different scenarios:
tg://protocol link: This is designed to directly launch the local Telegram app (if it's installed on the user's device). The format you shared is correct:
Replacetg://resolve?domain={USER_NAME}&text=Hi, default message{USER_NAME}with the target account's username (without the@symbol). For example, if the account is@JaneSmith, the link becomestg://resolve?domain=JaneSmith&text=Hi, default message.https://t.meweb/app link: This is a universal link that works across all devices—if the user has the Telegram app installed, it'll open the app; if not, it'll redirect to the Telegram web interface. Your format here is also correct:
Again, swaphttps://t.me/{USER_NAME}?text=Hi, default message{USER_NAME}for the actual username (no@). For@JaneSmith, that would behttps://t.me/JaneSmith?text=Hi, default message.
关键注意事项
- URL-encode special characters: If your pre-filled text includes spaces, commas, question marks, or other special characters, you'll need to URL-encode them to avoid breaking the link. For example:
- A space becomes
%20 - A comma becomes
%2C - A question mark becomes
%3F
So the messageHi, how's it going?would becomeHi%2C%20how%27s%20it%20going%3F, making the full link:
https://t.me/JaneSmith?text=Hi%2C%20how%27s%20it%20going%3F - A space becomes
- Bot vs. User accounts: These links work for both regular user accounts and Telegram bots—no extra setup needed as long as the target account has a public username.
内容的提问来源于stack exchange,提问作者H Aßdöü




