]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/ChatCommand.php
guessing game controls
[alttp.git] / app / TwitchBot / ChatCommand.php
index d03f7829e2704923f3b72780a8b3f1fd12596fb2..f2e11b61dd4bda83c4eb89652eb9aed7aa4fb34e 100644 (file)
@@ -3,7 +3,6 @@
 namespace App\TwitchBot;
 
 use App\Models\Channel;
-use Illuminate\Support\Arr;
 
 abstract class ChatCommand {
 
@@ -16,6 +15,9 @@ abstract class ChatCommand {
                        case 'guessing-cancel':
                                $cmd = new GuessingCancelCommand();
                                break;
+                       case 'guessing-leaderboard':
+                               $cmd = new GuessingLeaderboardCommand();
+                               break;
                        case 'guessing-solve':
                                $cmd = new GuessingSolveCommand();
                                break;
@@ -59,10 +61,11 @@ abstract class ChatCommand {
        }
 
        protected function listAnd($entries) {
-               return Arr::join($entries, ', ', ' and ');
+               return $this->channel->listAnd($entries);
        }
 
        protected function messageChannel($str) {
+               if (empty($str)) return;
                $msg = IRCMessage::privmsg($this->channel->twitch_chat, $str);
                $this->bot->sendIRCMessage($msg);
        }