I'm writing a telegram bot now and I have a question. As I know any user can link to a bot using "@" symbol, like this @my_bot. Is there any possibility to make such a link, that when a user click on it, not only he is redirected to this bot, but also a specific command is sent to this bot by a user automatically. Something like this @my_bot/my_command. I've tried this link, but it doesn't work. I don't know, if it is possible, maybe you do. Thanks in advance!
Asked
Active
Viewed 5,473 times
1 Answers
6
You can use a deep link adding an additional parameter
https://t.me/mybot?start=task_name
The deep link opens the bot with the start
command, the additional parameter is passed to your handler to customise what the start command_handler should do.

Beppe C
- 11,256
- 2
- 19
- 41
-
Ok^ thank you, and is it possible to make it running any other command? – barmirbar Aug 22 '20 at 14:02
-
1It looks like the start command is the only option when deep linking https://core.telegram.org/bots#deep-linking – Beppe C Aug 23 '20 at 14:42
-
@BeppeC according to the mentioned docs, there is also a "startgroup" parameter for deep linking. – Samuel Aug 04 '21 at 20:36
-
1Current docs URL is https://core.telegram.org/api/links#bot-links – Iván Sainz Nov 29 '22 at 18:07