-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
42 lines (27 loc) · 840 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
require __DIR__ . "/./vendor/autoload.php";
// throw new Exception('sjdsk');
use BotMan\BotMan\BotMan;
use BotMan\BotMan\BotManFactory;
use BotMan\BotMan\Drivers\DriverManager;
use Twilio\Twiml;
use BotMan\Drivers\Web\WebDriver;
$config = [
'twilio' => [
// Enter your token here
'token' => '#####',
]
];
// Load the driver(s) you want to use
DriverManager::loadDriver(\BotMan\Drivers\Twilio\TwilioMessageDriver::class); // Twilio driver
DriverManager::loadDriver(WebDriver::class); // Web driver
// Create an instance
$botman = BotManFactory::create($config);
// Give the bot something to listen for.
$botman->hears('hello', function (BotMan $bot) {
$bot->reply('never give up baby');
});
$botman->fallback(function($bot) {
$bot->reply('dksd skjdf ksj fds jdf');
});
$botman->listen();