check for string message
This commit is contained in:
parent
d1bc2196fa
commit
0187bc7bce
|
@ -58,8 +58,9 @@
|
||||||
(defn load-commands []
|
(defn load-commands []
|
||||||
(http-get "chat-commands.js" execute-commands-js nil))
|
(http-get "chat-commands.js" execute-commands-js nil))
|
||||||
|
|
||||||
(defn check-suggestion [db text]
|
(defn check-suggestion [db message]
|
||||||
(when-let [suggestion-text (re-matches #"^![^\s]+\s" text)]
|
(when-let [suggestion-text (when (string? message)
|
||||||
|
(re-matches #"^![^\s]+\s" message))]
|
||||||
(let [suggestion-text' (s/trim suggestion-text)
|
(let [suggestion-text' (s/trim suggestion-text)
|
||||||
[suggestion] (filter #(= suggestion-text' (:text %))
|
[suggestion] (filter #(= suggestion-text' (:text %))
|
||||||
(get-commands db))]
|
(get-commands db))]
|
||||||
|
|
Loading…
Reference in New Issue