-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnknownBotCommand.php
More file actions
31 lines (29 loc) · 984 Bytes
/
Copy pathUnknownBotCommand.php
File metadata and controls
31 lines (29 loc) · 984 Bytes
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
<?php
/**
* Class UnknownBotCommand
* This class handles bot command which is not recognized by the BotCommandFactory.
*
* @author: Angelito Sardez, Jr.
* @date: 12/11/2017
*/
class UnknownBotCommand extends BotCommand {
public function __construct($command, $sender, $user) {
parent::__construct($command, $sender, $user);
}
protected function executeCommand($parameter) {
$this->send(["attachment"=>[
"type"=>"template",
"payload"=>[
"template_type"=>"button",
"text"=>"Sorry, ".$this->user->getFirstName().". I don't know the command \"".$this->command."\". You may want to check the commands I support by typing \"HELP\" or by clicking the button below.",
"buttons"=>[
[
"type"=>'postback',
"title"=>'Display Help',
"payload"=>'help'
]
]
]
]]);
}
}