devture/synology-chat
Composer 安装命令:
composer require devture/synology-chat
包简介
A library to communicate with the Synology Chat API
关键字:
README 文档
README
A library to communicate with the Synology Chat API (just Incoming Webhooks for now).
Installation
Install through composer: composer require --dev devture/synology-chat
Usage
Preparation
$communicator = new \Devture\Component\SynologyChat\Communicator(new \GuzzleHttp\Client()); $client = new \Devture\Component\SynologyChat\Client($communicator);
Actual usage
$incomingWebhookUrl = 'https://chat.DOMAIN/chat/webapi/entry.cgi?api=SYNO.Chat.External&method=incoming&version=2&token=some-token'; try { $client->sendWebhookMessage($incomingWebhookUrl, 'Hello!'); } catch (\Devture\Component\SynologyChat\Exception\AuthFailure $e) { // Bad token. No such incoming webhook? } catch (\Devture\Component\SynologyChat\Exception $e) { // Another error. Likely transient and can be retried. }
统计信息
- 总下载量: 4.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2019-06-20