ledc/notify

推送通知SDK(AnPush、Bark、Chanify、钉钉、Discord、Gitter、GoogleChat、IGot、Iyuu、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、西智、亿风传花、Zulip)。

资助包维护!
微信

v8.0.2 2024-05-18 15:44 UTC

This package is auto-updated.

Last update: 2024-09-18 16:27:44 UTC


README

注意

推送通知SDK(AnPush、Bark、Chanify、钉钉、Discord、Gitter、GoogleChat、IGot、Iyuu、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、西智、亿风传花、Zulip)。

tests check & fix styling codecov Latest Stable Version GitHub release (with filter) Total Downloads License

平台支持

相关仓库

要求

  • PHP >= 8.2

安装

composer require ledc/notify -v

使用示例

// 1. Create authenticator
$authenticator = new Guanguans\Notify\DingTalk\Authenticator(
    'c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73',
    // 'SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51'
);

// 2. Create client
$client = new Guanguans\Notify\DingTalk\Client($authenticator);

// 3. Create message
$message = Guanguans\Notify\DingTalk\Messages\BtnsActionCardMessage::make([
    'title' => 'This is title(keyword).',
    'text' => 'This is text.',
    // 'btnOrientation' => 1,
    // 'btns' => [
    //     [
    //         'title' => 'This is title 1.',
    //         'actionURL' => 'https://github.com/guanguans/notify',
    //     ],
    // ],
])
    ->btnOrientation(1)
    ->addBtn([
        'title' => 'This is title 2.',
        'actionURL' => 'https://github.com/guanguans/notify',
    ]);

// 4. Send message
$response = $client
    // ->baseUri('base-uri')
    // ->connectTimeout(10)
    // ->debug(true)
    // ->proxy('http://127.0.0.1:1087')
    // ->timeout(30)
    // ->verify(false)
    // ->push(
    //     GuzzleHttp\Middleware::log(
    //         new Psr\Log\NullLogger,
    //         new GuzzleHttp\MessageFormatter(GuzzleHttp\MessageFormatter::DEBUG)
    //     ),
    //     'log'
    // )
    // ->before(
    //     'log',
    //     GuzzleHttp\Middleware::mapRequest(
    //         static fn (Psr\Http\Message\RequestInterface $request) => $request
    //     ),
    // )
    ->send($message)
    ->dump()
    // ->throw()
    ->json();

测试

composer test

更新日志

请参阅更新日志以获取最近更改的更多信息。

贡献

请参阅贡献指南以获取详细信息。

安全漏洞

请参阅我们的安全策略了解如何报告安全漏洞。

鸣谢

许可

MIT许可(MIT)。请参阅许可文件以获取更多信息。