Skip to content

Commit

Permalink
Merge pull request #118 from hichris1234/ignore-more-messages
Browse files Browse the repository at this point in the history
Avoid ChatActionError when messages have been deleted
  • Loading branch information
Manishearth committed Jan 12, 2016
2 parents 8c2137d + 9ed01c9 commit 149ce28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chatexchange/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ def _do_action_despite_throttling(self, action):

unpacked = Client._unpack_response(response)
ignored_messages = ["ok", "It is too late to delete this message",
"It is too late to edit this message"]
"It is too late to edit this message",
"The message has been deleted and cannot be edited",
"This message has already been deleted."]
if isinstance(unpacked, basestring) and unpacked not in ignored_messages:
match = re.match(TOO_FAST_RE, unpacked)
if match: # Whoops, too fast.
Expand Down

0 comments on commit 149ce28

Please sign in to comment.