A
A
aks03vova2018-04-03 16:57:52
PHP
aks03vova, 2018-04-03 16:57:52

How to make command order for bot?

There is a bot. Have it accept the /new command and then send the user a message like "Send a title". The user sends an ordinary string like "MyName". This is the question: how to implement this? So that the bot accepts a string from the user only after / new

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
riot26, 2018-04-03
@aks03vova

Store state for users. Set it with the /new command and accept a string if a certain state is set.

A
Andrey Sanych, 2018-04-03
@mountpoint

maybe just set some flag?

private $isInit= false;

public function init()
{
  $this->isInit = true;
}

public function isInit()
{
  return $this->isInit;
}

And then use somewhere in the code$this->isInit()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question