aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-05-15 22:21:50 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2020-05-25 15:55:40 +0200
commit5c3879f05a1e46a9752bfb519d442205e61590af (patch)
treedfbfda65615f742fda93425b2b09df22af2732c6 /wee_slack.py
parente3f8da8cd4e580303b2cf24d13549a9a18bfe797 (diff)
downloadwee-slack-5c3879f05a1e46a9752bfb519d442205e61590af.tar.gz
Show a colon between attachment fields title and value
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 50bb966..0dbc01c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -3486,13 +3486,11 @@ def unwrap_attachments(message_json, text_before):
elif image_url:
link_shown = True
- fields = attachment.get("fields")
- if fields:
- for f in fields:
- if f.get('title'):
- t.append('%s %s' % (f['title'], f['value'],))
- else:
- t.append(f['value'])
+ for field in attachment.get("fields", []):
+ if field.get('title'):
+ t.append('{}: {}'.format(field['title'], field['value']))
+ else:
+ t.append(field['value'])
files = unwrap_files(attachment, None)
if files: