9

Is it possible to craft a t.me URL that prompts the user to send a specific message to a specific bot. The closest I've found so far is t.me/share/url?url=my%20message, but that doesn't specify a username so the user has to choose one. I don't see the t.me URLs documented anywhere.

Note: this is not the same as sending a message via the API.

Isvara
  • 3,403
  • 1
  • 28
  • 42

1 Answers1

7

You can use deep linking to bot, use following format like this link:

https://t.me/username?start=<token>

Your backend will receive /start <token> . The user however will just see normal

 /start

on their chat window.

Sean Wei
  • 7,433
  • 1
  • 19
  • 39
  • 1
    When I try that, I just get a "Start" button that sends "/start" with nothing else. – Isvara Apr 03 '18 at 23:54
  • 2
    Oh, I see... only "/start" appears, but the whole thing is sent in the webhook message. – Isvara Apr 03 '18 at 23:56
  • 1
    Is any other query param than start working? Or do I have to put all in there e.g. `https://t.me/username?start=subscribe_` & `https://t.me/username?start=unsubscribe_`. Rather than `https://t.me/username?subscribe=` & `https://t.me/username?unsubscribe=` – Andi Giga Mar 22 '19 at 11:01
  • 4
    @AndiGiga unfortunately, you can only use ?start=sub_xxx at this time :( – Sean Wei Mar 23 '19 at 12:20