diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-10-13 15:21:04 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-10-13 15:21:04 -0700 |
commit | 008ec806f6bb0c88622ecfe86873472166c8a042 (patch) | |
tree | 9e0bc3549c589cc8d3e50dd44f8b976bc17ba2d1 | |
parent | 2c83f02c3774d04a6a1b1344e7eab8dcb49bcfbc (diff) | |
download | wee-slack-008ec806f6bb0c88622ecfe86873472166c8a042.tar.gz |
expand all attachments, not just the first
-rw-r--r-- | wee_slack.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 9d9c5bc..5155d32 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -232,7 +232,8 @@ def process_message(message_json): channel = message_json["channel"] user = user_hash[message_json["message"]["user"]] if message_json["message"].has_key("attachments"): - text = message_json["message"]["attachments"][0]["fallback"] + attachments = [x["text"] for x in message_json["message"]["attachments"]] + text = "\n".join(attachments) text = text.encode('ascii', 'ignore') else: text = "%s\tEDITED: %s" % (user, message_json["message"]["text"]) |