E
E
extramez2019-05-04 13:50:28
PHP
extramez, 2019-05-04 13:50:28

Telegramm Bot Php how to get /start parameter?

I am writing a bot for a cart, I need a referral system, the user ID is transmitted via the link https://t.me/bot/start=id
, and at the start I get the message /start {ID} Maybe a stupid question, but I don’t understand how to get this parameter {ID}?
I write in php, I use the TelegramBot\Api library

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Anakidze, 2019-05-04
@gpskwlkr

Just extract the messages from the text with this command, that's all. Take the message received at /start and cut off the first 6 characters from the string (the length of "/start") and get the ID. You can also remove extra spaces for sure, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question