public function setHandler(
        $message,
        $type,
        \fpoirotte\Pssht\HandlerInterface $handler
    ) {
        if (!is_int($type) || $type < 0 || $type > 255) {
            throw new \InvalidArgumentException();
        }

        if (!is_int($message)) {
            if (!($message instanceof \fpoirotte\Pssht\Messages\CHANNEL\REQUEST\Base)) {
                throw new \InvalidArgumentException();
            }
            $message = $message->getChannel();
        }

        $this->handlers[$message][$type] = $handler;
        return $this;
    }