X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FGuessingSolveCommand.php;h=b4a877d5b45d8b9378bb0cab431830872d46f6ec;hb=dc4019f7a7aa5ba98964e52e481d9d22ed080f3c;hp=57ee5f840424640a7f54e9031a650dfc44700ecb;hpb=7fc357a5943bf280ce2fa9aa97ec516af61efd69;p=alttp.git diff --git a/app/TwitchBot/GuessingSolveCommand.php b/app/TwitchBot/GuessingSolveCommand.php index 57ee5f8..b4a877d 100644 --- a/app/TwitchBot/GuessingSolveCommand.php +++ b/app/TwitchBot/GuessingSolveCommand.php @@ -6,15 +6,13 @@ class GuessingSolveCommand extends ChatCommand { public function execute($args) { if (!$this->channel->hasActiveGuessing()) { - $this->messageChannel('Channel has no active guessing game'); + $msg = $this->channel->getGuessingSetting('not_active_message'); + $this->messageChannel($msg); return; } - if (empty($args)) { - $this->messageChannel('Please provide a solution to the guessing game'); - return; - } - if (!$this->channel->isValidGuess($args)) { - $this->messageChannel('Please provide a valid solution to the guessing game'); + if (empty($args) || !$this->channel->isValidGuess($args)) { + $msg = $this->channel->getGuessingSetting('invalid_solution_message'); + $this->messageChannel($msg); return; } $winners = $this->channel->solveGuessing($args); @@ -25,9 +23,12 @@ class GuessingSolveCommand extends ChatCommand { } } if (empty($names)) { - $this->messageChannel('nobody wins :('); + $msg = $this->channel->getGuessingSetting('no_winners_message'); + $this->messageChannel($msg); } else { - $this->messageChannel('Congrats '.$this->listAnd($names)); + $msg = $this->channel->getGuessingSetting('winners_message'); + $msg = str_replace('{names}', $this->listAnd($names), $msg); + $this->messageChannel($msg); } $this->channel->clearGuessing(); }