websvc / php-rocketchat-webhooks
一个用于向Rocket Chat incoming webhooks发送请求的PHP接口。
1.0.0
2018-04-08 02:40 UTC
This package is auto-updated.
Last update: 2024-09-04 18:13:03 UTC
README
向Rocket Chat incoming webhooks发送请求
与Rocket Chat服务器v 0.63.0进行测试
安装
composer require websvc/php-rocketchat-webhooks 1.0.0
Rocket Chat配置
在管理中创建一个新的Incomming Hook并获取带令牌的URL。
用法
简单消息
$client = new \PhpRocketChatWebhooks\Client('https://rocket.chat/hooks/TOKEN', "Optional-Username"); $client->sendRequest("Hello World!");
带附件的消息
$client = new \PhpRocketChatWebhooks\Client('https://rocket.chat/hooks/TOKEN', "Optional-Username"); $client->sendRequest("Hello World!", [ 'title' => "Google homepage", 'title_link' => "https://google.com", 'text' => "text text text text text text text", 'image_url' => "https://www.google.pt/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png", ]);
为我买杯咖啡
如果你想感谢我,你可以为我买杯咖啡。咖啡永远不会嫌多 :)