%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/ugotscom/kma/app/Http/Controllers/
Upload File :
Create Path :
Current File : /home/ugotscom/kma/app/Http/Controllers/BotManController2.php

<?php
namespace App\Http\Controllers;
   
use BotMan\BotMan\BotMan;
use Illuminate\Http\Request;
use BotMan\BotMan\Messages\Incoming\Answer;
   
class BotManController extends Controller
{
    /**
     * Place your BotMan logic here.
     */
    public function handle()
    {
        $botman = app('botman');
   
        $botman->hears('{message}', function($botman, $message) {
   
            if ($message == 'hi') {
                $this->askName($botman);
            }
            elseif($message == 'rent'){
                $botman->reply("Looking for a property for rent.");
            }
            else{
                $botman->reply("write 'hi' for testing...");
            }
   
        });
   
        $botman->listen();
    }
   
    /**
     * Place your BotMan logic here.
     */
    public function askName($botman)
    {
        $botman->ask('Hello! What is your Name?', function(Answer $answer) {
   
            $name = $answer->getText();
   
            $this->say('Nice to meet you '.$name);
            
        });
    }
    
}

Zerion Mini Shell 1.0