Skip to content

Commit

Permalink
class file rename
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyutang committed Jul 22, 2019
1 parent 4f48347 commit 6180a08
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
```php
// text 类型
use DingTalkRobot\At;
use DingTalkRobot\DingTalkGroup;
use DingTalkRobot\GroupChat;
use DingTalkRobot\Messages\TextMessage;
use DingTalkRobot\RobotClient;
use DingTalkRobot\ChatBot;

// 链式调用设置 @ 多个手机号
$at = new At();
Expand All @@ -33,16 +33,16 @@ $message = new TextMessage();
$message->setContent('我就是我, 是不一样的烟火')
->setAt($at);

$client = new RobotClient();
$client = new ChatBot();
// 可以指定群,若不设置则发送默认的群
$client->send($message, new DingTalkGroup('other'));
$client->send($message, new GroupChat('other'));
```
---
```php
// markdown 类型
use DingTalkRobot\DingTalkGroup;
use DingTalkRobot\GroupChat;
use DingTalkRobot\Messages\MarkdownMessage;
use DingTalkRobot\RobotClient;
use DingTalkRobot\ChatBot;

$markdown = new MarkdownMessage();
$markdown->setTitle('杭州天气')
Expand All @@ -51,9 +51,9 @@ $markdown->setTitle('杭州天气')
"> ![screenshot](http://tinyurl.com/y4lbucte)\n" .
"> 10点20分发布 [天气](http://www.thinkpage.cn/)");

$client = new RobotClient();
$client = new ChatBot();

$client->send($markdown, new DingTalkGroup());
$client->send($markdown, new GroupChat());
```
## 相关
* [钉钉开发文档:自定义机器人](https://open-doc.dingtalk.com/microapp/serverapi2/qf2nxq#-9)
Expand Down
6 changes: 3 additions & 3 deletions src/RobotClient.php → src/ChatBot.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
use DingTalkRobot\Messages\BaseMessage;

/**
* Class RobotClient
* Class ChatBot
* @package DingTalkRobot
*/
class RobotClient
class ChatBot
{
/**
* @param BaseMessage $message
* @param DingTalkGroup $group
* @param GroupChat $group
* @return bool|false|string
*/
public function send($message, $group)
Expand Down
6 changes: 3 additions & 3 deletions src/DingTalkGroup.php → src/GroupChat.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
namespace DingTalkRobot;

/**
* Class DingTalkGroup
* Class GroupChat
* @package DingTalkRobot
*/
class DingTalkGroup
class GroupChat
{
/**
* @var string $token 要发送的钉钉群的token
*/
private $token;

/**
* DingTalkGroup constructor.
* GroupChat constructor.
* @param string $name 钉钉群名
*/
public function __construct($name = 'default')
Expand Down

0 comments on commit 6180a08

Please sign in to comment.