src/Extension/AbstractMessageHandler.php
final public function messageHandler(Collection $collection)
    {
        if ($collection['type'] === 'text' && $this->isAdmin($collection['username'])) {
            if (starts_with($collection['content'], $this->name.' ')) {
                $content = str_replace($this->name.' ', '', $collection['content']);

                switch ($content) {
                    case  'info':
                        $this->applicationInfo($collection);
                        break;
                    case 'on':
                        $this->setStatus(true, $collection);
                        break;
                    case 'off':
                        $this->setStatus(false, $collection);
                        break;
                    default:
                        break;
                }
            }
        }

        if (!$this->status) {
            return false;
        }

        return $this->handler($collection);
    }
final public function messageHandler(Collection $collection)
    {
        if ($collection['type'] === 'text' && $this->isAdmin($collection['username'])) {
            if (starts_with($collection['content'], $this->name.' ')) {
                $content = str_replace($this->name.' ', '', $collection['content']);

                switch ($content) {
                    case  'info':
                        $this->applicationInfo($collection);
                        break;
                    case 'on':
                        $this->setStatus(true, $collection);
                        break;
                    case 'off':
                        $this->setStatus(false, $collection);
                        break;
                    default:
                        break;
                }
            }
        }

        if (!$this->status) {
            return false;
        }

        return $this->handler($collection);
    }
消息处理器.

@param Collection $collection

@return mixed