中文在线一区二区_欧美在线综合_久久久久久综合_欧美一区二区三区视频_国产免费看_国产福利精品一区

群機器人

使用說明

使用前必須先在群組里面添加機器人,然后將 Webhook 地址 中的 key 取出來,作為示例中 $groupKey 的值。

發送文本類型消息

快速發送文本消息

<?php
// 獲取 Messenger 實例
$messenger = $work->group_robot_messenger;

// 群組 key
$groupKey = 'ab4f609a-3feb-427c-ae9d-b319ca712d36';

$messenger->message('大家好,我是本群的"喝水提醒小助手"')->toGroup($groupKey)->send();
// 或者寫成
$messenger->toGroup($groupKey)->send('大家好,我是本群的"喝水提醒小助手"');

使用 Text 發送文本消息

<?php
// 準備消息
$text = new \EasySwoole\WeChat\Work\GroupRobot\Messages\Text('hello');

// 發送
$messenger->message($text)->toGroup($groupKey)->send();

@某人:

<?php
// 通過構造函數傳參
$text = new \EasySwoole\WeChat\Work\GroupRobot\Messages\Text('hello', 'her-cat', '18700000000');
//$text = new Text('hello', ['her-cat', 'easyswoole'], ['18700000000', '18700000001']);

// 通過 userId
$text->mention('her-cat');
//$text->mention(['her-cat', 'easyswoole']);

// 通過手機號
$text->mentionByMobile('18700000000');
//$text->mentionByMobile(['18700000000', '18700000001']);

// @所有人
$text->mention('@all');
//$text->mentionByMobile('@all');

$messenger->message($text)->toGroup($groupKey)->send();

發送 Markdown 類型消息

<?php
$content = '
# 標題一
## 標題二
<font color="info">綠色</font>
<font color="comment">灰色</font>
<font color="warning">橙紅色</font>
> 引用文字
';

$markdown = new \EasySwoole\WeChat\Work\GroupRobot\Messages\Markdown($content);

$messenger->message($markdown)->toGroup($groupKey)->send();

發送圖片類型消息

<?php
$img = file_get_contents('http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png');

$image = new \EasySwoole\WeChat\Work\GroupRobot\Messages\Image(base64_encode($img), md5($img));

$result = $messenger->message($image)->toGroup($groupKey)->send();

發送圖文類型消息

<?php
$items = [
    new \EasySwoole\WeChat\Work\GroupRobot\Messages\NewsItem([
        'title' => '中秋節禮品領取',
        'description' => '今年中秋節公司有豪禮相送',
        'url' => 'http://www.jrrswxmm.cn',
        'image' => 'http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png',
    ]),

    //...
];

$news = new \EasySwoole\WeChat\Work\GroupRobot\Messages\News($items);

$messenger->message($news)->toGroup($groupKey)->send();

其他方式

使用 group_robot 發送消息。

$work->groupRobot->message('大家好,我是本群的"喝水提醒小助手"')->toGroup($groupKey)->send();
主站蜘蛛池模板: 在线播放一区二区三区 | 国产精国产精品 | 91视频.com| 欧美日韩国产成人 | 色国产精品 | 久久大伊人 | 在线观看日韩 | 一级毛片观看 | 亚洲视频欧美视频 | 国产成人精品一区二区三区福利 | 毛片在线视频 | 午夜精品在线观看 | 中文字幕第一页在线 | 久草电影网| 日韩精品视频在线 | 亚洲一区二区三区免费 | 曰批免费视频播放免费 | 欧美在线观看免费观看视频 | 久久久久久高清 | 中文字幕精品一区 | 亚洲欧美在线观看 | 亚洲a网 | 久久精品日产第一区二区三区 | 亚洲综合av一区 | 在线黄av| 国产高清美女一级a毛片久久 | 精品成人网 | 欧美第一视频 | 国产午夜精品视频 | 亚洲国产精品一区久久av篠田 | 日本在线免费 | 久久精品国产亚洲一区二区三区 | 九九人人 | 精品国产一区二区三区久久久蜜月 | 亚洲www视频 | 永久91嫩草亚洲精品人人 | 特级淫片日本高清视频免费 | 欧美精品国产精品 | 亚洲精品99 | 国产成人一区二区三区 | 午夜久久久 |