|
@@ 143-148 (lines=6) @@
|
| 140 |
|
} |
| 141 |
|
|
| 142 |
|
// 群发视频消息给用户列表时,视频消息格式需要另外处理,具体见文档 |
| 143 |
|
if ($this->msgType === Broadcast::MSG_TYPE_VIDEO) { |
| 144 |
|
if (is_array($this->message)) { |
| 145 |
|
$this->message = array_shift($this->message); |
| 146 |
|
} |
| 147 |
|
$this->msgType = 'mpvideo'; |
| 148 |
|
} |
| 149 |
|
|
| 150 |
|
$content = (new Transformer($this->msgType, $this->message))->transform(); |
| 151 |
|
|
|
@@ 175-182 (lines=8) @@
|
| 172 |
|
throw new InvalidArgumentException('This preview by not exist.'); |
| 173 |
|
} |
| 174 |
|
|
| 175 |
|
if (empty($this->msgType)) { |
| 176 |
|
throw new RuntimeException('Message type not exist.'); |
| 177 |
|
} elseif ($this->msgType === Broadcast::MSG_TYPE_VIDEO) { |
| 178 |
|
if (is_array($this->message)) { |
| 179 |
|
$this->message = array_shift($this->message); |
| 180 |
|
} |
| 181 |
|
$this->msgType = 'mpvideo'; |
| 182 |
|
} |
| 183 |
|
|
| 184 |
|
if (empty($this->message)) { |
| 185 |
|
throw new RuntimeException('No message content to send.'); |