Fix exception when dispatch-command returns nil

Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
Sebastian Crane 2022-02-28 21:09:05 +00:00
parent 8502f6980d
commit 293fa41d3b
1 changed files with 3 additions and 3 deletions

View File

@ -9,9 +9,9 @@
(defn irc-callback [state config connection type & m]
(let [{:keys [channel]} (:irc config)
{:keys [nick text target]} type]
(when (= target channel)
(doseq [line (str/split-lines (dispatch-command state nick text))]
(irclj.core/message connection channel line)))))
(some->> (dispatch-command state nick text)
(str/split-lines)
(run! (partial irclj.core/message connection channel)))))
(defn new-irc-connection [state config]
(let [{:keys [server port name nick channel]} (:irc config)]