X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FTwitchBot%2FGuessingSolveCommand.php;h=e825791d374040d3c19b5bc641c403b55da8d818;hb=HEAD;hp=b4a877d5b45d8b9378bb0cab431830872d46f6ec;hpb=93f50820771a0333b169f76f74727239cf0cb286;p=alttp.git diff --git a/app/TwitchBot/GuessingSolveCommand.php b/app/TwitchBot/GuessingSolveCommand.php index b4a877d..e825791 100644 --- a/app/TwitchBot/GuessingSolveCommand.php +++ b/app/TwitchBot/GuessingSolveCommand.php @@ -16,20 +16,8 @@ class GuessingSolveCommand extends ChatCommand { return; } $winners = $this->channel->solveGuessing($args); - $names = []; - foreach ($winners as $winner) { - if ($winner->score > 0) { - $names[] = $winner->uname; - } - } - if (empty($names)) { - $msg = $this->channel->getGuessingSetting('no_winners_message'); - $this->messageChannel($msg); - } else { - $msg = $this->channel->getGuessingSetting('winners_message'); - $msg = str_replace('{names}', $this->listAnd($names), $msg); - $this->messageChannel($msg); - } + $msg = $this->channel->listGuessingWinners($winners); + $this->messageChannel($msg); $this->channel->clearGuessing(); }