forked from LibreGaming/matchbot
Add !help IRC command
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
parent
55379e1e81
commit
71deb2c91d
10
src/bot.clj
10
src/bot.clj
|
@ -48,6 +48,13 @@
|
||||||
", "
|
", "
|
||||||
(sort-case-insensitive (map name (game/get-games state))))))
|
(sort-case-insensitive (map name (game/get-games state))))))
|
||||||
|
|
||||||
|
(defn help-string [& {:keys []}]
|
||||||
|
" !list - show all the games that have a list of players
|
||||||
|
!match game - announce a match of game to all of its players
|
||||||
|
!players game - show all the players of game
|
||||||
|
!add game - add yourself to the list of players for game
|
||||||
|
!remove game - remove yourself from the list of players for game")
|
||||||
|
|
||||||
(defn split-message [message]
|
(defn split-message [message]
|
||||||
(let [message-parts (str/split message #"\s")
|
(let [message-parts (str/split message #"\s")
|
||||||
command (if-let [x (first message-parts)] (str/lower-case x) "")
|
command (if-let [x (first message-parts)] (str/lower-case x) "")
|
||||||
|
@ -81,4 +88,7 @@
|
||||||
(condp = command
|
(condp = command
|
||||||
"!list"
|
"!list"
|
||||||
(list-games-string :state @state)
|
(list-games-string :state @state)
|
||||||
|
|
||||||
|
"!help"
|
||||||
|
(help-string)
|
||||||
nil))))
|
nil))))
|
||||||
|
|
Loading…
Reference in New Issue