Skip to content

Commit

Permalink
[BUGFIX] Auto reconnect botty to Slack
Browse files Browse the repository at this point in the history
This patch ensures the connection to Slack by periodically restart the connection.

Solves NeoBlack#13
  • Loading branch information
gilbertsoft committed Oct 31, 2019
1 parent 242eaf9 commit 60e4c51
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Resources/Privat/Scripts/botty.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,13 @@
}
});

$loop->addPeriodicTimer(60, function () use ($client) {
$client->disconnect()->then(function () {
echo "Disconnected!\n";
});
$client->connect()->then(function () {
echo "Connected!\n";
});
});

$loop->run();

0 comments on commit 60e4c51

Please sign in to comment.