File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 1111 [org.flywaydb/flyway-core " 5.2.4" ]
1212 [com.taoensso/timbre " 4.10.0" ]
1313 [cheshire " 5.9.0" ]
14- [toucan " 1.14.0" ]]
14+ [toucan " 1.14.0" ]
15+ [clj-http " 3.10.0" ]]
1516 :main ^:skip-aot wheel.core
1617 :target-path " target/%s"
1718 :profiles {:uberjar {:aot :all }
Original file line number Diff line number Diff line change 1+ (ns wheel.slack.webhook
2+ (:require [clj-http.client :as http]
3+ [cheshire.core :as json]))
4+
5+ (defn post-message! [webhook-url text attachments]
6+ (let [body (json/generate-string {:text text
7+ :attachments attachments})]
8+ (http/post webhook-url {:content-type :json
9+ :body body})))
10+
11+
12+ (comment
13+ (post-message! webhook-url " ranging failed"
14+ [{:color :danger
15+ :fields [{:title " Channel Name"
16+ :value :tata-cliq
17+ :short true }
18+ {:title " Channel Id"
19+ :value " UA"
20+ :short true }
21+ {:title " Event Id"
22+ :value " 2f763cf7-d5d7-492c-a72d-4546bb547696" }]}]))
You can’t perform that action at this time.
0 commit comments