Omit sender of !match command from players list
Signed-off-by: Sebastian Crane <seabass-labrax@gmx.com>
This commit is contained in:
parent
d9dc7acd34
commit
2f27cb8a86
|
@ -16,6 +16,7 @@
|
||||||
(defn match-string [& {:keys [state game player]}]
|
(defn match-string [& {:keys [state game player]}]
|
||||||
(as-> (keywordise-game game) x
|
(as-> (keywordise-game game) x
|
||||||
(game/get-players-of-game state x)
|
(game/get-players-of-game state x)
|
||||||
|
(disj x player)
|
||||||
(sort-case-insensitive x)
|
(sort-case-insensitive x)
|
||||||
(str/join " " x)
|
(str/join " " x)
|
||||||
(str "Anyone ready for " game "? " x)))
|
(str "Anyone ready for " game "? " x)))
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
(if game
|
(if game
|
||||||
(condp = command
|
(condp = command
|
||||||
"!match"
|
"!match"
|
||||||
(match-string :state @state :game game)
|
(match-string :state @state :game game :player sender)
|
||||||
|
|
||||||
"!add"
|
"!add"
|
||||||
(do (swap! state game/add-player-of-game game-keyword sender)
|
(do (swap! state game/add-player-of-game game-keyword sender)
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
(sort-case-insensitive ["C" "A" "b"]))))
|
(sort-case-insensitive ["C" "A" "b"]))))
|
||||||
|
|
||||||
(deftest match-string-test
|
(deftest match-string-test
|
||||||
(is (= '"Anyone ready for quasi-Rts? 123 abc"
|
(is (= '"Anyone ready for quasi-Rts? abc"
|
||||||
(match-string :state test-state :game "quasi-Rts"))))
|
(match-string :state test-state :game "quasi-Rts" :player "123"))))
|
||||||
|
|
||||||
(deftest list-players-string-test
|
(deftest list-players-string-test
|
||||||
(is (= "Players of HYPOTHETICAL-shooter: _123_ _abc_ _xyz_"
|
(is (= "Players of HYPOTHETICAL-shooter: _123_ _abc_ _xyz_"
|
||||||
|
|
Loading…
Reference in New Issue