Browse Source

Slack hooks: concatenate attachments' fallbacks

master
Chris Smith 5 years ago
parent
commit
1c925f10a9
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      lineandsinker/services/slack.py

+ 5
- 1
lineandsinker/services/slack.py View File

@@ -13,4 +13,8 @@ class Slack(Service):
13 13
         else:
14 14
             content = json.loads(request.form["payload"])
15 15
 
16
-        yield {"type": f"slack", "source": identifier, "text": content["text"]}
16
+        text = content["text"]
17
+        if "attachments" in content:
18
+            text += " " + " ".join(a["fallback"] for a in content["attachments"])
19
+
20
+        yield {"type": f"slack", "source": identifier, "text": text}

Loading…
Cancel
Save