From 60e4c51f8274c5a637520e35ff91ada42bc40f75 Mon Sep 17 00:00:00 2001 From: Gilbertsoft <25326036+gilbertsoft@users.noreply.github.com> Date: Thu, 31 Oct 2019 12:43:10 +0100 Subject: [PATCH] [BUGFIX] Auto reconnect botty to Slack This patch ensures the connection to Slack by periodically restart the connection. Solves #13 --- Resources/Privat/Scripts/botty.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Resources/Privat/Scripts/botty.php b/Resources/Privat/Scripts/botty.php index f57a43a..2c2285a 100644 --- a/Resources/Privat/Scripts/botty.php +++ b/Resources/Privat/Scripts/botty.php @@ -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();