src/Contact/Groups.php
public function add($username)
    {
        $result = $this->vbot->http->json(sprintf('%s/webwxbatchgetcontact?type=ex&r=%s&pass_ticket=%s', $this->vbot->config['server.uri.base'], time(), $this->vbot->config['server.passTicket']), [
            'Count'       => 1,
            'BaseRequest' => $this->vbot->config['server.baseRequest'],
            'List'        => [
                [
                    'ChatRoomId' => '',
                    'UserName'   => $username,
                ],
            ],
        ], true);

        if ($result['BaseResponse']['Ret'] != 0) {
            throw new CreateGroupException('create group chat fail.');
        }

        $this->put($username, $result['ContactList'][0]);

        return $result['ContactList'][0];
    }
public function add($username)
    {
        $result = $this->vbot->http->json(sprintf('%s/webwxbatchgetcontact?type=ex&r=%s&pass_ticket=%s', $this->vbot->config['server.uri.base'], time(), $this->vbot->config['server.passTicket']), [
            'Count'       => 1,
            'BaseRequest' => $this->vbot->config['server.baseRequest'],
            'List'        => [
                [
                    'ChatRoomId' => '',
                    'UserName'   => $username,
                ],
            ],
        ], true);

        if ($result['BaseResponse']['Ret'] != 0) {
            throw new CreateGroupException('create group chat fail.');
        }

        $this->put($username, $result['ContactList'][0]);

        return $result['ContactList'][0];
    }
增加群聊天到group.

@param $username

@throws CreateGroupException

@return bool