Created
October 31, 2011 07:32
-
-
Save zakwilson/1327073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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