You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function transformVideo(array $message)
{
if (3 !== count($message)) {
throw new InvalidArgumentException('send message to openids, the message must be three arguments.');
}
return [
'video' => [
'media_id' => $message[0],
'title' => $message[1],
'description' => $message[2],
],
'msgtype' => 'video',
];
}
The text was updated successfully, but these errors were encountered:
我用的环境
PHP 版本:
overtrue/wechat 版本:3.1
问题及现象
消息群发,指定openid群发视频时,微信报错invalid message type hint: [JUs0Oa0779ge25]
微信官方文档中写的是
{
"touser":[
"OPENID1",
"OPENID2"
],
"mpvideo":{
"media_id":"123dsdajkasd231jhksad",
"title":"TITLE",
"description":"DESCRIPTION"
},
"msgtype":"mpvideo"
}
wechat/src/Broadcast/Transformer.php代码中:
public function transformVideo(array $message)
{
if (3 !== count($message)) {
throw new InvalidArgumentException('send message to openids, the message must be three arguments.');
}
return [
'video' => [
'media_id' => $message[0],
'title' => $message[1],
'description' => $message[2],
],
'msgtype' => 'video',
];
}
The text was updated successfully, but these errors were encountered: