Answers for "php botman"

PHP
0

php botman

use BotMan\BotMan\BotMan;
use BotMan\BotMan\Messages\Incoming\Answer;
 
 public function handle()
    {
       $botman=app("botman");

       $botman->hears("{message}",function($botman,$message)
       {
         if($message=="hi")
         {
           $this->askName($botman);
         }
         else
         {
           $botman->reply("kindly write hi to start the talk");
         }
       });

       $botman->listen();

    }


    public function askName($botman)
    {
      $botman->ask("Hello what is your name",function(Answer $answer)
      {
        $name=$answer->getText();
        $this->say("Nice to meet you"." ".$name);

      });
    }
Posted by: Guest on October-09-2021
0

php bot libraries

$botman->hears('single response', function (BotMan $bot) {
    $bot->reply("Tell me more!");
});
Posted by: Guest on September-12-2020

Browse Popular Code Answers by Language