Skip to content

Commit

Permalink
Merge pull request #29 from nalbam/main
Browse files Browse the repository at this point in the history
Refactor chat_update function to handle exceptions when sending new m…
  • Loading branch information
nalbam authored Sep 5, 2024
2 parents 9fa9e58 + 87900bd commit 4f23f54
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,12 @@ def chat_update(say, channel, thread_ts, latest_ts, message="", continue_thread=
else:
time.sleep(1)

# New message
result = say(text=text, thread_ts=thread_ts)
latest_ts = result["ts"]
try:
# Send a new message
result = say(text=text, thread_ts=thread_ts)
latest_ts = result["ts"]
except Exception as e:
print("chat_update: Error: {}".format(e))

return message, latest_ts

Expand Down

0 comments on commit 4f23f54

Please sign in to comment.