public static function resolve(TwitchBot $bot, TwitchBotCommand $cmd) {
switch ($cmd->command) {
+ case 'adlib-chat':
+ return new AdlibChatCommand($bot, $cmd);
+ case 'chat':
+ return new ChatCommand($bot, $cmd);
case 'join':
return new JoinCommand($bot, $cmd);
case 'part':
return new PartCommand($bot, $cmd);
+ case 'random-chat':
+ return new RandomChatCommand($bot, $cmd);
default:
- throw new Exception('unrecognized command');
+ throw new \Exception('unrecognized command');
}
}
return User::findOrFail($this->getParameter('user'));
}
+ protected function getExecutingUser() {
+ return $this->command->user;
+ }
+
protected function hasParameter($name) {
return array_key_exists($name, $this->command->parameters);
}