Skip to content

Commit

Permalink
auto_reconnect option added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericgig committed Jan 10, 2019
1 parent 4cf46f4 commit b0c8867
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paperbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit b0c8867

Please sign in to comment.