yian / ding-bot-sdk
A SDK for DingTalk bot develop
v1.0.0
2020-08-11 17:24 UTC
Requires
- guzzlehttp/guzzle: ^6.5
Requires (Dev)
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-11-12 02:58:04 UTC
README
钉钉群机器人开发工具
安装
composer require yian/ding-bot-sdk
使用
<?php use Ding\Bot; $url = 'Your bot webhook url'; // 机器人地址 $options = [ 'secret' => "Your secret", // 如果安全设置中勾选了“加签”,则需要提供 ]; $bot = new Bot($url, $options); $msg = [ 'msgtype' => 'text', 'text' => [ 'content' => '大家好', ], ]; var_dump($bot->send($msg)); // string(27) "{"errcode":0,"errmsg":"ok"}"