aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-05-27 08:28:31 -0700
committerRyan Huber <rhuber@gmail.com>2015-05-27 08:28:31 -0700
commita34977e52735a133ad232e09e53cb099991206f1 (patch)
tree57fb6c56b6fe0d13a80c4e800df8a91d21d73df0 /wee_slack.py
parentf4384af0f7b934c3dfe5889febeb0337680c836b (diff)
downloadwee-slack-a34977e52735a133ad232e09e53cb099991206f1.tar.gz
reactions for old messages fix
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/wee_slack.py b/wee_slack.py
index a4089b7..f40cc79 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1191,12 +1191,14 @@ def do_reaction(message_json):
#text = message["text"].encode('utf-8')
channel.buffer_prnt_changed(None, "", message_json["item"]["ts"], append)
-def create_reaction_string(reaction):
- reaction_string = " [{}]".format(reaction)
-# reaction_string = ' ['
-# for r in reactions:
-# reaction_string += ":{}:{} ".format(r["name"], r["count"])
-# reaction_string = reaction_string[:-1] + ']'
+def create_reaction_string(reactions):
+ if type(reactions) != []:
+ reaction_string = " [{}]".format(reactions)
+ else:
+ reaction_string = ' ['
+ for r in reactions:
+ reaction_string += ":{}:{} ".format(r["name"], r["count"])
+ reaction_string = reaction_string[:-1] + ']'
return reaction_string
def cache_message(message_json, from_me=False):