Telegram URI Scheme to Send Message to Specified User
Asked Answered
R

2

6

I'm looking for a way to send message to telegram user from website with specific message. Something like WhatsApp's

https://wa.me/12345678901?text=Custom+message

I've found just this:

https://t.me/username

This allows to start chat with custom user but with blank message field.

Is there any way to start a chat with custom user (even he is not in my phonebook or userlist) with fulfilled message field?

Revulsion answered 10/7, 2019 at 12:54 Comment(0)
T
1

Any of the following formats should work:

https://t.me/share/url?url={url}&text={text}
https://telegram.me/share/url?url={url}&text={text}
tg://msg_url?url={url}&text={text}

This means you will have as options:

  • url : URL to share.
  • text : Text to share.

The official documentation confirms as much.

If you are interested in watching a project that keeps track of these URLs, then check us out!: https://github.com/bradvin/social-share-urls#whatsapp

Social Share URLs

Tardiff answered 14/5, 2020 at 20:15 Comment(2)
Thanks for your answer. Such url will open telegram and ask to select a user. I need something that will open direct chat with custom user.Revulsion
Hi, Ariakas! Right, as indicated by the documentation, there is no such thing. Feel free to take a look at this related answer I have: https://mcmap.net/q/1925514/-linkedin-share-to-individualTardiff
E
-1
<a href="tg://msg?text=Hello&to=+42333" id="telegram_share" class="mobileShare" title="inviteFriends" alt="telegram_share”/>

You can try redirecting above link in WebView.

Education answered 10/7, 2019 at 13:0 Comment(1)
Thanks for the response. That link just opens telegram without opened chat. I've tried phone numbers with/without plus sign and username.Revulsion

© 2022 - 2024 — McMap. All rights reserved.