浏览代码

Slack hooks: concatenate attachments' fallbacks

master
Chris Smith 6 年前
父节点
当前提交
1c925f10a9
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5
    1
      lineandsinker/services/slack.py

+ 5
- 1
lineandsinker/services/slack.py 查看文件

@@ -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}

正在加载...
取消
保存