diff --git a/src/bot.clj b/src/bot.clj index 59ce976..477d78a 100644 --- a/src/bot.clj +++ b/src/bot.clj @@ -16,6 +16,7 @@ (defn match-string [& {:keys [state game player]}] (as-> (keywordise-game game) x (game/get-players-of-game state x) + (disj x player) (sort-case-insensitive x) (str/join " " x) (str "Anyone ready for " game "? " x))) @@ -63,7 +64,7 @@ (if game (condp = command "!match" - (match-string :state @state :game game) + (match-string :state @state :game game :player sender) "!add" (do (swap! state game/add-player-of-game game-keyword sender) diff --git a/test/bot_test.clj b/test/bot_test.clj index e0845bb..9081722 100644 --- a/test/bot_test.clj +++ b/test/bot_test.clj @@ -18,8 +18,8 @@ (sort-case-insensitive ["C" "A" "b"])))) (deftest match-string-test - (is (= '"Anyone ready for quasi-Rts? 123 abc" - (match-string :state test-state :game "quasi-Rts")))) + (is (= '"Anyone ready for quasi-Rts? abc" + (match-string :state test-state :game "quasi-Rts" :player "123")))) (deftest list-players-string-test (is (= "Players of HYPOTHETICAL-shooter: _123_ _abc_ _xyz_"