diff --git a/src/Wechat/Work/Message/MessageInterface.php b/src/Wechat/Work/Message/MessageInterface.php index b61fc35..b0366b3 100644 --- a/src/Wechat/Work/Message/MessageInterface.php +++ b/src/Wechat/Work/Message/MessageInterface.php @@ -67,6 +67,13 @@ abstract class MessageInterface $this->type => $this->attr, ]); break; + case self::TYPE_IMAGE: + $params = array_merge($params, [ + $this->type => [ + 'media_id' => $this->attr['media_id'], + ], + ]); + break; default: throw new \Exception('message type ' . $this->type . ' is not allow'); } diff --git a/src/Wechat/Work/Message/TextImageMessage.php b/src/Wechat/Work/Message/TextImageMessage.php new file mode 100644 index 0000000..f4b2236 --- /dev/null +++ b/src/Wechat/Work/Message/TextImageMessage.php @@ -0,0 +1,16 @@ +type = self::TYPE_IMAGE; + $this->attr['media_id'] = $content; + } + +} \ No newline at end of file