src/Commands/AdminCommands/CleanupCommand.php 1 location
|
@@ 331-343 (lines=13) @@
|
| 328 |
|
* |
| 329 |
|
* @return \Longman\TelegramBot\Entities\ServerResponse |
| 330 |
|
*/ |
| 331 |
|
public function executeNoDb() |
| 332 |
|
{ |
| 333 |
|
$message = $this->getMessage(); |
| 334 |
|
$chat_id = $message->getChat()->getId(); |
| 335 |
|
|
| 336 |
|
$data = [ |
| 337 |
|
'chat_id' => $chat_id, |
| 338 |
|
'parse_mode' => 'Markdown', |
| 339 |
|
'text' => '*No database connection!*', |
| 340 |
|
]; |
| 341 |
|
|
| 342 |
|
return Request::sendMessage($data); |
| 343 |
|
} |
| 344 |
|
|
| 345 |
|
/** |
| 346 |
|
* Command execute method |
src/Commands/Command.php 1 location
|
@@ 165-177 (lines=13) @@
|
| 162 |
|
* @return \Longman\TelegramBot\Entities\ServerResponse |
| 163 |
|
* @throws \Longman\TelegramBot\Exception\TelegramException |
| 164 |
|
*/ |
| 165 |
|
public function executeNoDb() |
| 166 |
|
{ |
| 167 |
|
//Preparing message |
| 168 |
|
$message = $this->getMessage(); |
| 169 |
|
$chat_id = $message->getChat()->getId(); |
| 170 |
|
|
| 171 |
|
$data = [ |
| 172 |
|
'chat_id' => $chat_id, |
| 173 |
|
'text' => 'Sorry no database connection, unable to execute "' . $this->name . '" command.', |
| 174 |
|
]; |
| 175 |
|
|
| 176 |
|
return Request::sendMessage($data); |
| 177 |
|
} |
| 178 |
|
|
| 179 |
|
/** |
| 180 |
|
* Get update object |