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

群機器人

使用說明

使用前必須先在群組里面添加機器人,然后將 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://m.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();
主站蜘蛛池模板: 亚洲 自拍 另类 欧美 丝袜 | 亚洲一区二区三区免费看 | 亚洲精品福利在线观看 | 天堂av中文在线 | 日韩欧美成人一区二区三区 | 色天天综合久久久久综合片 | 亚洲无线观看 | 视频一区中文字幕 | 久久国产精品99久久久久久老狼 | 日韩欧美在线观看一区二区三区 | 久久99亚洲精品 | 日本不卡免费新一二三区 | 爱干视频 | 99精品视频一区二区三区 | 国产成在线观看免费视频 | 国产a级黄色毛片 | 国产精品久久久久久久一区探花 | 欧美日韩激情一区 | 动漫精品一区二区 | 国产特级毛片aaaaaaa高清 | 久久综合久久久 | 中文字幕在线免费观看 | 羞羞动漫网 | 超碰一区 | 久久久www成人免费精品 | 亚洲综合视频在线 | 特级西西人体444www高清大胆 | 在线播放中文字幕 | 交视频在线观看国产 | 狠狠干狠狠干 | 日韩精品一区二区三区在线观看视频网站 | 国产高清精品一区 | 亚洲欧美一区二区三区在线 | 欧美日韩中文字幕在线 | 欧美在线视频一区 | 福利视频网站 | 久久久www成人免费无遮挡大片 | 日韩欧美中文字幕一区二区三区 | 在线婷婷| 狠狠av | 国产人体视频 |