Pre-filled message to a Telegram number
Asked Answered
H

3

8

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?

Heel answered 5/11, 2019 at 18:43 Comment(0)
L
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.

Lockup answered 7/11, 2019 at 17:2 Comment(0)
A
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

Adolfo answered 12/5, 2020 at 16:41 Comment(1)
Can a user be specified as part of the URI as well?Corduroys
N
0

You can use this on the web:

Using phone number

https://web.t.me/{phoneNumber}?text={message}

phoneNumber must start with + followed by country code. Eg: +6017...

Using username

Username: https://web.t.me/{username}?text={message}

username must not have @

Nether answered 17/7 at 10:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.