7

Here I found a very useful answer showing how to send a pre-filled message from a website using whatsapp.

Can we do the same with Telegram?

Freiheit
  • 8,408
  • 6
  • 59
  • 101

2 Answers2

4

You can try to use open a Telegram chat with:

  1. https://t.me/username
  2. tg://resolve?domain=username

And send a message to your contact with tg://msg?text=Text&to=+(user mobile number)

But sending not works for me.

Dmytro Hoi
  • 141
  • 6
4

All of these URLs should be valid...

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}

The official API documentation source: Core.Telegram.org: Widgets -> Sharing Button

They suggest the t.me format. You may prefill the following fields:

  • url : The URL you want to share.
  • text : Text to accompany the URL you want to share.

So, for instance, you might have...

https://t.me/share/url?url=http%3A%2F%2Fwww.revoltlib.com%2F&text=Revolt+Library

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#telegramme

Social Share URLs

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133