3 namespace App\TwitchBot;
5 class GuessingSolveCommand extends ChatCommand {
7 public function execute($args) {
8 if (!$this->channel->hasActiveGuessing()) {
9 $msg = $this->channel->getGuessingSetting('not_active_message');
10 $this->messageChannel($msg);
13 if (empty($args) || !$this->channel->isValidGuess($args)) {
14 $msg = $this->channel->getGuessingSetting('invalid_solution_message');
15 $this->messageChannel($msg);
18 $winners = $this->channel->solveGuessing($args);
19 $msg = $this->channel->listGuessingWinners($winners);
20 $this->messageChannel($msg);
21 $this->channel->clearGuessing();