php-wechat-sdk/src/Wechat/Work/Message.php
2019-02-19 16:14:18 +08:00

26 lines
455 B
PHP

<?php
namespace Wechat\Work;
use Wechat\Work\MessageInterface;
class Message
{
/**
* @var Work
*/
protected $work;
public function __construct($work)
{
$this->work = $work;
}
public function send($msg)
{
$request = $this->work->transformForJsonRequest('message/send',
$msg->toArray() + ['agentid' => $this->work->getAgentId()]);
return $this->work->request($request);
}
}