Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telegram bot - add unique key to /start command

I'm trying to identify each user by some unique key, which is added to /start command. For each user, I will generate some key, and show URL to the user. This is described step by step in the official documentation https://core.telegram.org/bots#deep-linking

Link for the users is in the format:

https://telegram.me/ExampleBot?start=uniqueKey

It works perfectly in the telegram app. The probem is, that when opened in the browser, only button "Start" is visible. When the user clicks, the uniqueKey is not send to the bot.

How to add a uniqueKey to /start command to make it work in telegram web app too? How should look like the generated URL? So user can just click, and does not need to write the code?

like image 208
Petr Adam Avatar asked Oct 17 '22 00:10

Petr Adam


1 Answers

Make your uniqueKey as Base64 and test again...

Based on Telegram documents it is recommended to using base64url to encode parameters with binary and other types of content.

like image 102
Ramin Bateni Avatar answered Nov 03 '22 00:11

Ramin Bateni