;; SPDX-License-Identifier: Apache-2.0 ;; SPDX-FileCopyrightText: 2022 Sebastian Crane (ns bot (:require [clojure.string :as str] [game] [irclj.core])) (defn sorted-players-of-game [state game] (->> game (str/lower-case) (keyword) (game/get-players-of-game state) (sort))) (defn match-string [state game] (str "Anyone ready for " game "? " (str/join " " (sorted-players-of-game state game)))) (defn list-players-string [state game] (let [players (str/join (map #(str " _" % "_") (sorted-players-of-game state game)))] (str "Players of " game ":" players))) (defn add-player-string [player game] (str "Added " player " to the list of players for " game "!")) (defn remove-player-string [player game] (str "Removed " player " from the list of players for " game "!"))