问题
So I found out I could use a link like this in HTML:
<a href="https://api.whatsapp.com/send?phone={{phone_number}}" target="_blank">WhatsApp</a>
in order to let a user contact {{phone_number}}
directly from a webpage (via WhatsApp web).
My question is: how to do the same but instead of WhatsApp, via Telegram?
Thank you in advance
回答1:
It's NOT possible to link to Telegram like this for a phone numbers so far, because every user MUST add the phone number to their contact list before they can send a message to them by phone number. This limitation is because of Telegram privacy policy and abuse prevention. In more details, if Telegram allow this type of linking, a malicious party can fetch a web page like https://t.me/+1XXXXXXX
for every possible number without passing authentication. That's most probably why Telegram doesn't have such linking feature.
However, you can link to @username
of a Telegram user if he/she has any:
https://t.me/username
回答2:
Welcome to StackOverflow.
You should create a link like https://telegram.me/YourUsername for that purpose.
Check Telegram blog for more info.
来源:https://stackoverflow.com/questions/54251613/how-to-create-a-link-to-contact-specific-phone-number-via-telegram