This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-19
Channels
- # announcements (3)
- # babashka (42)
- # beginners (84)
- # calva (3)
- # cider (13)
- # clj-kondo (9)
- # cljs-dev (6)
- # cljsrn (32)
- # clojure (47)
- # clojure-argentina (4)
- # clojure-france (2)
- # clojure-spec (17)
- # clojure-uk (15)
- # clojuredesign-podcast (4)
- # clojurescript (41)
- # conjure (53)
- # cursive (16)
- # data-science (5)
- # duct (1)
- # emacs (11)
- # events (1)
- # exercism (3)
- # fulcro (48)
- # graalvm (20)
- # graphql (1)
- # joker (3)
- # kaocha (2)
- # malli (2)
- # meander (6)
- # pathom (3)
- # planck (18)
- # rdf (3)
- # re-frame (14)
- # ring-swagger (1)
- # shadow-cljs (15)
- # specter (1)
Yeah, that's fair. I might still be battling OOP ideas, where I want an intermediate value to compose later values, but not expose/export it.
It looks like ^:private
is an option, but that seems overkill for this case at least. 🙂
@penryu imo let + def is ok. It’s more the nested defn + defs that are used for debugging but not production worthy
ah, i totally assumed this was being thought of in the context of being inside a def-ish form. borkdude's comment seems more accurate.
because I see env variables: does babashka support setting them or does it share the limitations of JMV Clojure?
@mkvlr You can however set env vars for a child process created with ProcessBuilder
or clojure.java.shell
v0.0.88: add clojure.data.xml
. See example script: https://github.com/borkdude/babashka/blob/master/examples/pom_version.clj
and a bunch of other enhancements/fixes.
https://github.com/borkdude/babashka/releases/tag/v0.0.88
hello, i have a little question, i’m writing a little script in babashka to check a website status and trying to send some logs back to slack i have this curl
curl -X POST --form "payload={\"username\": \"webhookbot\", \"text\": \"This is posted to #general and comes from a bot named webhookbot.\", \"icon_emoji\": \":ghost:\"}" <path>
that works fine
i tried to translated to babashka.curl but i got `400` on the all the requests
here are the functions I tried:
(defn send-to-slack [url text]
(curl/post url {:form-params {"payload" {"username" "webhookbot", "text" text, "icon_emoji" ":ghost:"}}}))
(defn send-to-slack [url text]
(curl/post url {:form-params {:payload (json/encode {"username" "webhookbot", "text" text, "icon_emoji" ":ghost:"})}}))
i’m sure that i’m doing somthing wrong with the `:form-params` , i look at the docs but i didn’t find anything useful in this case,
can somebody help me see what am i doing wrong? thanks in advance 🙂@UGTEF0BKL I can post with this function:
(defn send-to-slack [url text]
(curl/post url {:body (json/encode {"text" text})}))
from https://api.slack.com/messaging/webhooks > You cannot override the default channel (chosen by the user who installed your app), username, or icon when you're using Incoming Webhooks to post messages. Instead, these values will always inherit from the associated Slack app configuration.
@U0510902N that way to do the request is equivalent to this one
curl -X POST --data "{\"username\": \"webhookbot\", \"text\": \"text\", \"icon_emoji\": \":ghost:\"}"
no?
i’m still wondering why the other way doesn’t work :thinking_face: