Skip to content

Commit

Permalink
ensure client_msg_id exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sgratzl committed Aug 16, 2018
1 parent ce7db4d commit cdac5ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions example/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def archive(c):
count = 0
duplicates = 0
for msg in filter(f, c.msgs(before=before)):
if 'client_msg_id' not in msg.json:
msg.json['client_msg_id'] = str(msg.json['ts'])
try:
_ = archive.insert_one(msg.json)
count += 1
Expand Down
4 changes: 2 additions & 2 deletions slack_cleaner2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class SlackMessage(object):
internal model of a slack message
"""

ts = None # type: int
ts = None # type: float
"""
message timestamp
"""
Expand Down Expand Up @@ -316,7 +316,7 @@ def __init__(self, entry, user, channel, slack):
:type slack: SlackCleaner
"""

self.ts = entry['ts']
self.ts = float(entry['ts'])
self.text = entry['text']
self._channel = channel
self._slack = slack
Expand Down

0 comments on commit cdac5ae

Please sign in to comment.