$bot->reply('Got it - your age is: '.$age); $bot->userStorage()->save([ 'age' => $age ]); }); $botman->hears('How old am i', function($bot) { $user = $bot->userStorage()->get(); $bot->reply('You are '.$user->get('age')); });
= $answer->getText(); $this->askTopping(); }); public function askTopping() { $this->ask('What kind of topping do you want?', function($answer) { $this->topping = $answer->getText(); $this->askAddress(); }); }
$this->address = $answer->getText(); $this->say('Okay. That is all I need.'); $this->say('Size: '.$this->size); $this->say('Topping: '.$this->topping); $this->say('Delivery address: '.$this->address); });