From 71deb2c91dee8b9e68300530b285c42d54801866 Mon Sep 17 00:00:00 2001 From: Sebastian Crane Date: Sun, 27 Feb 2022 21:53:45 +0000 Subject: [PATCH] Add !help IRC command Signed-off-by: Sebastian Crane --- src/bot.clj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bot.clj b/src/bot.clj index 477d78a..9742371 100644 --- a/src/bot.clj +++ b/src/bot.clj @@ -48,6 +48,13 @@ ", " (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] (let [message-parts (str/split message #"\s") command (if-let [x (first message-parts)] (str/lower-case x) "") @@ -81,4 +88,7 @@ (condp = command "!list" (list-games-string :state @state) + + "!help" + (help-string) nil))))