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);
}
}
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();
}