ritaswc/wechat-work-robot

轻松发送 WechatWork 机器人消息

1.0.1 2020-11-12 08:05 UTC

This package is auto-updated.

Last update: 2024-09-23 20:42:00 UTC


README

轻松发送 WechatWork 机器人消息

使用方法

composer require ritaswc/wechat-work-robot

发送消息

$key = 'a45bxxxx-xxxx-xxxx-xxxx-fbf0a09cxxxx';
$robot = new \Ritaswc\WechatWorkRobot\WechatWorkRobot($key);

$robot->sendText('PHP is the best language in the world!', ['huixinchen', '@all']);
$robot->sendText('PHP is the best language in the world!', [], ['199****1322', '@all']);

$robot->sendImage('wechatpay.png');
$robot->sendImage('https://blogoss.yinghualuo.cn/blog/2019/05/wechatpay.png');

$robot->sendMarkDown("## 欢迎使用支付宝赞助
## 欢迎使用微信赞助");

$robot->sendNews([
    [
        'title'       => 'Charles的小星球',
        'description' => '一个PHP码农的自述',
        'url'         => 'https://blog.yinghualuo.cn',
        'picurl'      => 'https://blog.yinghualuo.cn/wp-content/themes/twentyseventeen/assets/images/header.jpg',
    ],
    [
        'title'       => 'Charles的小星球1',
        'description' => '一个PHP码农的自述1',
        'url'         => 'https://blog.yinghualuo.cn',
        'picurl'      => 'https://blog.yinghualuo.cn/wp-content/themes/twentyseventeen/assets/images/header.jpg',
    ]
]);

作者博客

Charles的小星球

钉钉文档

如何配置群机器人?

许可证

MIT

赞助商

QrCode