Telegram URL to send message to specific bot
Asked Answered
S

1

10

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.

Sworn answered 3/4, 2018 at 22:48 Comment(0)
D
8

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.

Denims answered 3/4, 2018 at 23:10 Comment(4)
When I try that, I just get a "Start" button that sends "/start" with nothing else.Sworn
Oh, I see... only "/start" appears, but the whole thing is sent in the webhook message.Sworn
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_<token> & https://t.me/username?start=unsubscribe_<token>. Rather than https://t.me/username?subscribe=<token> & https://t.me/username?unsubscribe=<token>Warrick
@AndiGiga unfortunately, you can only use ?start=sub_xxx at this time :(Denims

© 2022 - 2024 — McMap. All rights reserved.