Procházet zdrojové kódy

Slack hooks: concatenate attachments' fallbacks

master
Chris Smith před 6 roky
rodič
revize
1c925f10a9
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5
    1
      lineandsinker/services/slack.py

+ 5
- 1
lineandsinker/services/slack.py Zobrazit soubor

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

Načítá se…
Zrušit
Uložit