Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(def bot-name "irclj_bot_test")
(def irc-server "irc.freenode.net")
(def irc-channel "#clojure")
(def msgs (agent []))
(def info (agent []))
(defn log-info [{:keys [nick channel message irc errors doing]}]
(send info conj message))
(defn process-message [{:keys [nick channel message irc]}]
(send msgs conj message))
(def fnmap {:on-message process-message
:on-error log-info
:on-connect (fn [_] (println "\n\nON-CONNECT TRIGGERED.\n\n"))
:on-action log-info})
(def bot (connect (create-irc {:name bot-name
:server irc-server
:channels [irc-channel]
:fnmap fnmap
:realname bot-name
:username "irclj"})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.