channel->hasActiveGuessing()) { $this->messageChannel('Channel has no active guessing game'); 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'); return; } $winners = $this->channel->solveGuessing($args); $names = []; foreach ($winners as $winner) { if ($winner->score > 0) { $names[] = $winner->uname; } } if (empty($names)) { $this->messageChannel('nobody wins :('); } else { $this->messageChannel('Congrats '.$this->listAnd($names)); } $this->channel->clearGuessing(); } } ?>