xiaolin / x-dingtalk
钉钉机器人
0.0.1
2017-12-13 12:16 UTC
Requires
- php: >=5.6
- guzzlehttp/guzzle: ^6.3
- limingxinleo/support-collection: ^1.0
- pimple/pimple: ^3.0
Requires (Dev)
- phalcon/dd: ^1.1
- phpunit/phpunit: ^5.7
This package is not auto-updated.
Last update: 2025-03-02 07:38:54 UTC
README
自定义机器人
- 初始化
<?php use Xin\DingTalk\Application; $config = [ // HTTP 请求的超时时间(秒) 'timeout' => 5.0, // 机器人模块 'robot' => [ 'gateways' => [ 'test' => [ 'url' => $url, ], 'test2' => [ 'url' => $url, ], ], ], ]; $ding = new Application($config);
- 发送消息
<?php /** @var \Psr\Http\Message\ResponseInterface[] $res */ $res = $ding->robot->sendText('测试sendText方法', [], ['test']); /** @var \Psr\Http\Message\ResponseInterface[] $res */ $res = $this->ding->robot->sendMarkdown( '杭州天气', "#### 杭州天气 @156xxxx8827\n" . "> 9度,西北风1级,空气良89,相对温度73%\n\n" . "> \n" . "> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n", [], ['test'] );