支持文件

This commit is contained in:
侯登峰 2019-07-12 18:21:06 +08:00
parent 98f05653ad
commit 56ea314e71
2 changed files with 17 additions and 0 deletions

View File

@ -67,6 +67,7 @@ abstract class MessageInterface
$this->type => $this->attr,
]);
break;
case self::TYPE_FILE:
case self::TYPE_IMAGE:
$params = array_merge($params, [
$this->type => [

View File

@ -0,0 +1,16 @@
<?php
namespace Wechat\Work\Message;
use Wechat\Work\Message\MessageInterface;
class TextFileMessage extends MessageInterface
{
public function __construct($content)
{
$this->type = self::TYPE_FILE;
$this->attr['media_id'] = $content;
}
}