This is my routes file in laravel. Am matching any url with /botman that calls a closure which, registers a slack driver for botman and listens to the message hello.
In slack am trying to set the Request URL
under event subscriptions using this http://127.0.0.1:8000/botman
. I get "Your URL didn't respond with the value of the challenge parameter."
. What am I missing? is it on my routes file? or the url?
<?php
use BotMan\BotMan\BotMan;
use BotMan\BotMan\BotManFactory;
use BotMan\Drivers\Slack\SlackDriver;
use BotMan\BotMan\Drivers\DriverManager;
Route::match(['get', 'post'],'botman', function () {
DriverManager::loadDriver(SlackDriver::class);
// Create BotMan instance
$config = [
'slack' => [
'token' => '***slack Token***' //slack token
]
];
$botman = BotManFactory::create($config);
// give the bot something to listen for.
$botman->hears('hello', function (BotMan $bot) {
$bot->reply('Hello yourself.');
});
// start listening
$botman->listen();
});