From b0c88678f38154db6b6385b5906d78c492727114 Mon Sep 17 00:00:00 2001 From: Ericgig Date: Thu, 10 Jan 2019 14:29:03 -0500 Subject: [PATCH] auto_reconnect option added --- paperbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paperbot.py b/paperbot.py index c1d6bcf..5097bb7 100644 --- a/paperbot.py +++ b/paperbot.py @@ -373,7 +373,7 @@ def post(self, text): # instantiate Slack & Twilio clients slack_client = SlackClient(SLACK_BOT_TOKEN) - if slack_client.rtm_connect(): + if slack_client.rtm_connect(auto_reconnect=True): print("paperbot connected and running!") bot_id = slack_client.api_call("auth.test")["user_id"] prev2num = time_as_int(time.strftime("%H-%M-%S"))-1 @@ -396,7 +396,7 @@ def post(self, text): time.sleep(READ_WEBSOCKET_DELAY) except WebSocketConnectionClosedException: print("Lost connection to Slack. Reconnecting...") - if not slack_client.rtm_connect(): + if not slack_client.rtm_connect(auto_reconnect=True): print("Failed to reconnect to Slack") time.sleep(0.5) else: