public function sendBroadcastMessageToGroup (TypeInterface $message, $groupID)
    {
        $json = (new Formatter())->formatMessageForBroadcast($message);
        $json['filter']['group_id'] = (int)$groupID;

        $json = json_decode(
            $this->client->send(
                new Request(
                    "POST",
                    "https://api.weixin.qq.com/cgi-bin/message/mass/sendall",
                    [],
                    json_encode($json)
                )
            )->getBody()
        );

        if (! isset($json->msg_id)) {
            throw new Exception("bad response: expected property `msg_id`");
        }

        return $json->msg_id;
    }
public function sendBroadcastMessageToGroup (TypeInterface $message, $groupID)
    {
        $json = (new Formatter())->formatMessageForBroadcast($message);
        $json['filter']['group_id'] = (int)$groupID;

        $json = json_decode(
            $this->client->send(
                new Request(
                    "POST",
                    "https://api.weixin.qq.com/cgi-bin/message/mass/sendall",
                    [],
                    json_encode($json)
                )
            )->getBody()
        );

        if (! isset($json->msg_id)) {
            throw new Exception("bad response: expected property `msg_id`");
        }

        return $json->msg_id;
    }
public function sendBroadcastMessageToGroup ( TypeInterface $ message , $ groupID ) { $ json = ( new Formatter ( ) ) -> formatMessageForBroadcast ( $ message ) ; $ json [ 'filter' ] [ 'group_id' ] = ( int ) $ groupID ; $ json = json_decode ( $ this -> client -> send ( new Request ( "POST" , "https://api.weixin.qq.com/cgi-bin/message/mass/sendall" , [ ] , json_encode ( $ json ) ) ) -> getBody ( ) ) ; if ( ! isset ( $ json -> msg_id ) ) { throw new Exception ( "bad response: expected property `msg_id`" ) ; } return $ json -> msg_id ; }
Sends the given messages as a broadcast to the specified group. Returns the ID of the broadcast message, in order
to query the status of the message at a later stage.

@param TypeInterface $message
@param int           $groupID

@return int
@throws Exception
Sends the given messages as a broadcast to the specified group . Returns the ID of the broadcast message in order to query the status of the message at a later stage .