|
@@ -13,8 +13,13 @@ class Slack(Service):
|
13
|
13
|
else:
|
14
|
14
|
content = json.loads(request.form["payload"])
|
15
|
15
|
|
16
|
|
- text = content["text"]
|
|
16
|
+ text = content["text"].strip()
|
17
|
17
|
if "attachments" in content:
|
18
|
|
- text += " " + " ".join(a["fallback"] for a in content["attachments"])
|
|
18
|
+ text += " " + " ".join(
|
|
19
|
+ filter(
|
|
20
|
+ lambda x: len(x) > 0,
|
|
21
|
+ (a["fallback"].strip() for a in content["attachments"]),
|
|
22
|
+ )
|
|
23
|
+ )
|
19
|
24
|
|
20
|
25
|
yield {"type": f"slack", "source": identifier, "text": text}
|