Fork me on GitHub
#nbb
<
2022-06-13
>
teodorlu12:06:37

I'm wondering whether neil dep add ... should return an error if the library is not found on clojars / maven - rather than silently insert :mvn/version nil in deps.edn. I just ran neil dep add nextjournal/clerk. No errors, but what :mvn/version nil in deps.edn. Another option is adding fallback - clojars -> maven -> git (similar to :latest-sha behavior). Running neil dep add nextjournal/clerk :latest-sha caused the effect I wanted. :thinking_face:

teodorlu14:06:43

Realized that I meant to post this in #babashka. Well, now we have an even better channel!

borkdude12:06:24

yes, I think it should error or fall back. Perhaps we should create a neil channel Done: #babashka-neil

šŸ‘ 1
Jan K13:06:04

So nbb is kinda like lumo? Is there some big difference? Since Lumo is not maintained anymore it's nice to see a replacement

borkdude14:06:13

@jkr.sw It's similar in that they both target Node.js, but some main differences are: ā€¢ nbb is just an npm library which runs with the Node.js you already have installed, lumo required its own customized Node.js version for startup time reasons ā€¢ macros are more similar to Clojure JVM (can be defined in .cljs files without surprises) ā€¢ lumo is based on self-hosted ClojureScript compiler and in nbb clojure is evaluated using SCI (interpreter) which supports a large subset of Clojure, but not all of it ā€¢ nbb supports loading ES6 modules, lumo doesn't

šŸ‘ 1
cldwalker18:06:13

Looking forward to the next cool thing you build with #nbb! Maybe a slackbot or a voice assistant? šŸ˜›

borkdude18:06:41

I think other people have done such things already

cldwalker18:06:44

Cool. If you come across links for either of those, feel free to share as it would be fun to build those type of apps

borkdude18:06:17

@UUSQUGUF3 might have built something like that

šŸ‘ 1
Chris McCormick01:06:38

I have a Discord bot on a private repo. Will think about how to contribute it back as an example. :thinking_face:

Chris McCormick01:06:57

It's actually super trivial to post to Discord using a webhook.

Chris McCormick01:06:48

(def discord-webhook-url (env-required "DISCORD_WEBHOOK"))

(defn send-discord-message [msg]
  (let [content {:username "Friendly Bot"
                 :avatar_url "https://..../robot.jpg"
                 :content msg}]
    (fetch discord-webhook-url
           (clj->js {:method :POST
                     :headers {:content-type "application/json"}
                     :body (js/JSON.stringify (clj->js content))}))))

šŸ‘ 1