Answer the question
In order to leave comments, you need to log in
Entering command for telegram bot?
Now I use this option: /add [name]
and, accordingly, a regular expression for this:
preg_match('/\/add\s(.+)/i, $msg, $msg)
$msg = $msg[1];
...
Answer the question
In order to leave comments, you need to log in
We save an entry in the cache that we are waiting for a message from such and such a user and write a handler (callback) there. With each request, we check if there is something in the cache, if there is, then we call the callback, otherwise we call the standard command handler.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question