-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Description
The bot loses connection sometimes and does nothing with it. In slack chat (web-)application slackbot user just become with gray circle (offline). But the script continues to run, need to be killed and restarted. Isn't there a way to force the bot to check is connection alive and throw an exception if not?
The code (excepting code of commands and config):
<?php
require __DIR__ . '/vendor/autoload.php';
use PhpSlackBot\Bot;
use SlackBot\Commands\AlphaLockCommand;
use SlackBot\Commands\AlphaShipmentCommand;
use SlackBot\Commands\GetItemQtyCommand;
use SlackBot\Commands\StatusCommand;
$config = require __DIR__ . '/config.php';
$bot = new Bot();
$bot->setToken($config['slackbot']['token']);
try {
$bot->loadCommand(new StatusCommand());
$bot->loadCommand(new GetItemQtyCommand());
$bot->loadCommand(new AlphaLockCommand());
$bot->loadCommand(new AlphaShipmentCommand());
$bot->run();
} catch (\Exception $e) {
echo $e->getMessage(), "\n";
}
abackstrom