public function __construct(CommandPRIVMSG $message) { $this->message = $message; if ($message->getBotCommand() === false || $message->getBotCommandParams() === false) { throw new \InvalidArgumentException('This CommandPRIVMSG does not have a command associated; CommandEvent can not be fired.'); } $this->command = $message->getBotCommand(); $this->params = $message->getBotCommandParams(); }