src/Commands/SystemCommands/StartCommand.php 1 location
|
@@ 47-60 (lines=14) @@
|
44 |
|
* @return mixed |
45 |
|
* @throws \Longman\TelegramBot\Exception\TelegramException |
46 |
|
*/ |
47 |
|
public function execute() |
48 |
|
{ |
49 |
|
$message = $this->getMessage(); |
50 |
|
|
51 |
|
$chat_id = $message->getChat()->getId(); |
52 |
|
$text = 'Hi there!' . PHP_EOL . 'Type /help to see all commands!'; |
53 |
|
|
54 |
|
$data = [ |
55 |
|
'chat_id' => $chat_id, |
56 |
|
'text' => $text, |
57 |
|
]; |
58 |
|
|
59 |
|
return Request::sendMessage($data); |
60 |
|
} |
61 |
|
} |
62 |
|
|
src/Commands/Command.php 1 location
|
@@ 156-168 (lines=13) @@
|
153 |
|
* @return \Longman\TelegramBot\Entities\ServerResponse |
154 |
|
* @throws \Longman\TelegramBot\Exception\TelegramException |
155 |
|
*/ |
156 |
|
public function executeNoDb() |
157 |
|
{ |
158 |
|
//Preparing message |
159 |
|
$message = $this->getMessage(); |
160 |
|
$chat_id = $message->getChat()->getId(); |
161 |
|
|
162 |
|
$data = [ |
163 |
|
'chat_id' => $chat_id, |
164 |
|
'text' => 'Sorry no database connection, unable to execute "' . $this->name . '" command.', |
165 |
|
]; |
166 |
|
|
167 |
|
return Request::sendMessage($data); |
168 |
|
} |
169 |
|
|
170 |
|
/** |
171 |
|
* Get update object |