diff options
-rw-r--r-- | wee_slack.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/wee_slack.py b/wee_slack.py index cbe98ec..5098748 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -952,18 +952,19 @@ class Message(object): if "reactions" in self.message_json: found = False for r in self.message_json["reactions"]: - if r["name"] == reaction: - r["users"].add(user) + if r["name"] == reaction and user not in r["users"]: + r["users"].append(user) found = True + if not found: - self.message_json["reactions"].append({u"name": reaction, u"users": {user}}) + self.message_json["reactions"].append({u"name": reaction, u"users": [user]}) else: - self.message_json["reactions"] = [{u"name": reaction, u"users": {user}}] + self.message_json["reactions"] = [{u"name": reaction, u"users": [user]}] def remove_reaction(self, reaction, user): if "reactions" in self.message_json: for r in self.message_json["reactions"]: - if r["name"] == reaction: + if r["name"] == reaction and user in r["users"]: r["users"].remove(user) else: pass |