All Projects → guanguans → notify

guanguans / notify

Licence: MIT license
推送通知 sdk(Bark、Chanify、钉钉群机器人、Discord、邮件、飞书群机器人、Gitter、Google Chat、iGot、Logger、Mattermost、Now Push、PushBack、Push、PushDeer、PushPlus、QQ 频道机器人、Rocket Chat、Server 酱、Showdoc Push、Slack、Telegram、Webhook、企业微信群机器人、息知、Zulip)。

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to notify

laravel-exception-notify
Laravel 中异常监控报警通知(Bark、Chanify、钉钉群机器人、Discord、飞书群机器人、邮件、PushDeer、QQ 频道机器人、Server 酱、Slack、Telegram、企业微信群机器人、息知)。
Stars: ✭ 52 (-84.48%)
Mutual labels:  notifier, bark, qq-bot, chanify, pushdeer
Matterbridge
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Stars: ✭ 4,452 (+1228.96%)
Mutual labels:  slack, gitter, zulip, mattermost, rocketchat
SmsForwarder
短信转发器——监控Android手机短信、来电、APP通知,并根据指定规则转发到其他手机:钉钉群自定义机器人、钉钉企业内机器人、企业微信群机器人、飞书机器人、企业微信应用消息、邮箱、bark、webhook、Telegram机器人、Server酱、PushPlus、手机短信等。包括主动控制服务端与客户端,让你轻松远程发短信、查短信、查通话、查话簿、查电量等。(V3.0 新增)PS.这个APK主要是学习与自用,如有BUG请提ISSUE,同时欢迎大家提PR指正
Stars: ✭ 8,386 (+2403.28%)
Mutual labels:  webhook, bark, serverchan
st2chatops
Packaging environment for building StackStorm chatops native packages
Stars: ✭ 26 (-92.24%)
Mutual labels:  slack, mattermost, rocketchat
Tradingview Webhook Bot
⚙️ Send TradingView alerts to Telegram, Discord, Slack, Twitter and/or Email.
Stars: ✭ 135 (-59.7%)
Mutual labels:  slack, webhook
Rust Slack
A rust crate for sending messages to Slack via webhooks
Stars: ✭ 128 (-61.79%)
Mutual labels:  slack, webhook
Emberclear
Encrypted Chat. No History. No Logs.
Stars: ✭ 157 (-53.13%)
Mutual labels:  slack, gitter
Zulip
Zulip server and web app—powerful open source team chat
Stars: ✭ 14,815 (+4322.39%)
Mutual labels:  slack, zulip
Mattermost Openshift
An OpenShift 3 application template for mattermost
Stars: ✭ 27 (-91.94%)
Mutual labels:  slack, mattermost
Hooka
😎 A webhook server with zero coding
Stars: ✭ 180 (-46.27%)
Mutual labels:  slack, webhook
Sactive Bot
😈 An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
Stars: ✭ 212 (-36.72%)
Mutual labels:  slack, mattermost
Graylog Plugin Slack
Graylog alarm callback for Slack
Stars: ✭ 110 (-67.16%)
Mutual labels:  slack, mattermost
Gatus
⛑ Gatus - Automated service health dashboard
Stars: ✭ 1,203 (+259.1%)
Mutual labels:  slack, mattermost
Yfiton
Cross-platform CLI utility command for sending notifications using well-known or modern communication services
Stars: ✭ 142 (-57.61%)
Mutual labels:  slack, notifier
Octoslack
OctoPrint plugin for Slack, Mattermost, Pushbullet, Pushover, Rocket.Chat, Discord, Riot/Matrix, & Microsoft Teams
Stars: ✭ 50 (-85.07%)
Mutual labels:  slack, mattermost
Go Sarah
Simple yet customizable bot framework written in Go.
Stars: ✭ 188 (-43.88%)
Mutual labels:  slack, gitter
Matterircd
Connect to your mattermost or slack using your IRC-client of choice.
Stars: ✭ 241 (-28.06%)
Mutual labels:  slack, mattermost
rocketchat-uptimerobot
Uptime Robot integration for Rocket.Chat
Stars: ✭ 34 (-89.85%)
Mutual labels:  webhook, rocketchat
Zabbix Slack Alertscript
Zabbix AlertScript for Slack.com chat
Stars: ✭ 406 (+21.19%)
Mutual labels:  slack, webhook
Integrations
Connect your App to Multiple Messaging Channels with the W3C Open standard.
Stars: ✭ 721 (+115.22%)
Mutual labels:  slack, gitter

notify

简体中文 | ENGLISH

推送通知 sdk(Bark、Chanify、钉钉群机器人、Discord、邮件、飞书群机器人、Gitter、Google Chat、iGot、Logger、Mattermost、Now Push、PushBack、Push、PushDeer、PushPlus、QQ 频道机器人、Rocket Chat、Server 酱、Showdoc Push、Slack、Telegram、Webhook、企业微信群机器人、息知、Zulip)。

Tests Check & fix styling codecov Latest Stable Version Total Downloads License

相关项目

平台支持

环境要求

  • PHP >= 7.2

安装

$ composer require guanguans/notify -vvv

使用

Bark
use Guanguans\Notify\Factory;
use Guanguans\Notify\Clients\Client;

$barkMessage = new \Guanguans\Notify\Messages\BarkMessage([
    'title' => 'This is title.',
    'body' => 'This is body.',
    'copy' => 'This is copy.',
    'url' => 'https://github.com/guanguans/notify',
    'sound' => 'bell',
    'group' => 'group',
    // 'icon' => 'https://avatars0.githubusercontent.com/u/25671453?s=200&v=4',
    // 'group' => 'group',
    // 'level' => 'passive',
    // 'badge' => 5,
    // 'isArchive' => 1,
    // 'autoCopy' => 1,
    // 'automaticallyCopy' => 1,
]);
Factory::bark()
    // ->setBaseUri('The server address of your own deployment.')
    ->setToken('ihnPXb8KDj9dHStfQ5c')
    ->setMessage($barkMessage)
    ->sending(function (Client $client){
        // do something for before send
        dump($client->getRequestParams());
    })
    ->sended(function (Client $client){
        // do something for after send
        dump($client->getResponse());
    })
    ->send();
Chanify
// Text Message
Factory::chanify()
    // ->setBaseUri('The server address of your own deployment.')
    ->setToken('fh4gGEiJBQVdIWlVKS1JORVY0UlVETFZYVVpRTlNLTlVZVlZPT1JFGhR7vAyf8Uj5UQhhK4n6QfVzih96QyIECAEQAQ.E0eBnLbfNwWrWZ1YSAZfkCQWZAPdBl6pVr26lRf6Srs')
    ->setMessage((new \Guanguans\Notify\Messages\Chanify\TextMessage([
        'title'    => 'This is title.',
        'text'     => 'This is text.',
        // 'copy'     => 'This is copy.',
        // 'actions'  => [
        //     "ActionName1|http://<action host>/<action1>",
        //     "ActionName2|http://<action host>/<action2>",
        // ],
        // 'autocopy' => 0,
        // 'sound'    => 0,
        // 'priority' => 10,
    ])))
    ->send();

// Link Message
Factory::chanify()
    // ->setBaseUri('The server address of your own deployment.')
    ->setToken('fh4gGEiJBQVdIWlVKS1JORVY0UlVETFZYVVpRTlNLTlVZVlZPT1JFGhR7vAyf8Uj5UQhhK4n6QfVzih96QyIECAEQAQ.E0eBnLbfNwWrWZ1YSAZfkCQWZAPdBl6pVr26lRf6Srs')
    ->setMessage((new \Guanguans\Notify\Messages\Chanify\LinkMessage([
        'link'     => 'https://github.com/guanguans/notify',
        // 'sound'    => 0,
        // 'priority' => 10,
    ])))
    ->send();
钉钉群机器人
// Text Message
Factory::dingTalk()
    ->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
    ->setSecret('SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730')
    ->setMessage((new \Guanguans\Notify\Messages\DingTalk\TextMessage([
        'content'   => 'This is content(keyword).',
        // 'atMobiles' => [13948484984],
        // 'atDingtalkIds' => [123456],
        // 'isAtAll'   => false,
    ])))
    ->send();

// Link Message
Factory::dingTalk()
    ->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
    ->setSecret('SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730')
    ->setMessage((new \Guanguans\Notify\Messages\DingTalk\LinkMessage([
        'title'      => 'This is content.',
        'text'       => 'This is text(keyword).',
        'messageUrl' => 'https://github.com/guanguans/notify',
        'picUrl'     => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    ])))
    ->send();

// Markdown Message
Factory::dingTalk()
    ->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
    ->setSecret('SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730')
    ->setMessage((new \Guanguans\Notify\Messages\DingTalk\MarkdownMessage([
        'title' => 'This is title.',
        'text'  => '> This is text(keyword).',
        // 'atMobiles' => [13948484984],
        // 'atDingtalkIds' => [123456],
        // 'isAtAll'   => false,
    ])))
    ->send();

// Feed Card Message
$message = new \Guanguans\Notify\Messages\DingTalk\FeedCardMessage([
    'title'      => 'This is title(keyword) 0.',
    'messageURL' => 'https://github.com/guanguans/notify',
    'picURL'     => 'https://avatars.githubusercontent.com/u/22309277?v=4'
]);
Factory::dingTalk()
    ->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
    ->setSecret('SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730')
    ->setMessage($message)
    ->send();

// Single Action Card Message
Factory::dingTalk()
    ->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
    ->setSecret('SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730')
    ->setMessage(new \Guanguans\Notify\Messages\DingTalk\SingleActionCardMessage([
        'title'       => 'This is title(keyword).',
        'text'        => 'This is text.',
        'singleTitle' => 'This is singleTitle.',
        'singleURL'   => 'https://avatars.githubusercontent.com/u/22309277?v=4',
        // 'btnOrientation' => 1
    ]))
    ->send();

// Btns Action Card Message
$message = new \Guanguans\Notify\Messages\DingTalk\BtnsActionCardMessage([
    'title'          => 'This is title(keyword).',
    'text'           => 'This is text.',
    // 'hideAvatar'     => 1,
    // 'btnOrientation' => 1,
    'btns' => [
        [
            'title'     => 'This is title 1',
            'actionURL' => 'https://github.com/guanguans/notify',
        ]
    ]
]);
$message->addBtn([
    'title'     => 'This is title 2',
    'actionURL' => 'https://github.com/guanguans/notify',
]);
Factory::dingTalk()
    ->setToken('c44fec1ddaa8a833156efb77b7865d62ae13775418030d94d05da08bfca73e')
    ->setSecret('SECc32bb7345c0f73da2b9786f0f7dd5083bd768a29b82e6d460149d730eee51730')
    ->setMessage($message)
    ->send();
Discord
$message = new \Guanguans\Notify\Messages\DiscordMessage([
    'content' => 'This is content.',
    //'username' => 'notify bot.',
    //'avatar_url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //'tts' => false,
    //'embeds' => $embed = [
    //    'title' => 'This is title.',
    //    'type' => 'This is type.',
    //    'description' => 'This is description.',
    //    'url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //    'color' => '0365D6',
    //    'footer' => [
    //        'text' => 'This is text.',
    //        'icon_url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //    ],
    //    'image' => [
    //        'url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //    ],
    //    'thumbnail' => [
    //        'url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //    ],
    //    'author' => [
    //        'name' => 'This is name.',
    //        'url' => 'https://avatars.githubusercontent.com/u/22309277?v=4.',
    //        'icon_url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //    ],
    //    'fields' => [
    //        [
    //            'name' => 'This is name.',
    //            'value' => 'This is value.',
    //            'inline' => false,
    //        ],
    //    ],
    ],
]);

Factory::discord()
    ->setWebhookUrl('https://discord.com/api/webhooks/955407924304425000/o7RfCGxek_o8kfR6Q9i')
    ->setMessage($message)
    ->send();
邮件
# 安装依赖
$ composer require symfony/mailer -vvv
$email = \Guanguans\Notify\Messages\EmailMessage::create()
    ->from('[email protected]')
    ->to('[email protected]')
    //->cc('[email protected]')
    //->bcc('[email protected]')
    //->replyTo('[email protected]')
    // ->priority(\Guanguans\Notify\Messages\EmailMessage::PRIORITY_HIGH)
    ->subject('This is a testing for notify.')
    // ->html('<p>Sending emails is fun again!</p>')
    ->text('This is a testing.');

Factory::mailer()
    ->setDsn('smtp://user:[email protected]:465?verify_peer=0')
    ->setMessage($email)
    ->send();
飞书群机器人
// Text Message
Factory::feiShu()
    ->setToken('b6eb70d9-6e19-4f87-af48-348b028186')
    ->setSecret('iigDOvnsIn6aFS1pYHHEHh')
    ->setMessage(new \Guanguans\Notify\Messages\FeiShu\TextMessage('This is title(keyword).'))
    ->send();

// Post Message
$post = [
    'zh_cn' => [
        'title'   => '项目更新通知',
        'content' => [
            [
                [
                    "tag"  => "text",
                    "text" => "项目有更新(keyword)"
                ]
            ]
        ]
    ]
];
Factory::feiShu()
    ->setToken('b6eb70d9-6e19-4f87-af48-348b028186')
    ->setSecret('iigDOvnsIn6aFS1pYHHEHh')
    ->setMessage(new \Guanguans\Notify\Messages\FeiShu\PostMessage($post))
    ->send();

// Image Message
Factory::feiShu()
    ->setToken('b6eb70d9-6e19-4f87-af48-348b028186')
    ->setSecret('iigDOvnsIn6aFS1pYHHEHh')
    ->setMessage(new \Guanguans\Notify\Messages\FeiShu\ImageMessage('img_ecffc3b9-8f14-400f-a014-05eca1a4xxxx'))
    ->send();

// ShareChat Message
Factory::feiShu()
    ->setToken('b6eb70d9-6e19-4f87-af48-348b028186')
    ->setSecret('iigDOvnsIn6aFS1pYHHEHh')
    ->setMessage(new \Guanguans\Notify\Messages\FeiShu\ShareChatMessage('oc_f5b1a7eb27ae2c7b6adc2a74fafxxxxx'))
    ->send();

// Card Message
$card = [
    'elements' => [
        [
            'tag'  => 'div',
            'text' => [
                'content' => '**西湖(keyword)**,位于浙江省杭州市西湖区龙井路1号,杭州市区西部,景区总面积49平方千米,汇水面积为21.22平方千米,湖面面积为6.38平方千米。',
                'tag'     => 'lark_md',
            ],
        ],
    ],
];
Factory::feiShu()
    ->setToken('b6eb70d9-6e19-4f87-af48-348b0281866c')
    ->setSecret('iigDOvnsIn6aFS1pYHHEHh')
    ->setMessage(new \Guanguans\Notify\Messages\FeiShu\CardMessage($card))
    ->send();
Gitter
Factory::gitter()
    ->setToken('b9e7931ecacb08b7ab4df5e98bc149d33d7faf1')
    ->setRoomId('61af21b96da03739848bfef')
    ->setMessage(new \Guanguans\Notify\Messages\GitterMessage('This is testing.'))
    ->send();
Google Chat
Factory::googleChat()
    ->setToken('accessToken')
    ->setKey('accessKey')
    ->setSpace('space')
    // ->setThreadKey('threadKey')
    ->setMessage(new \Guanguans\Notify\Messages\GoogleChatMessage([
        'text' => 'This is a testing.',
    ]))
    ->send();
iGot
Factory::iGot()
    ->setToken('5dcd2f91d38cc47447414')
    ->setMessage(
        new \Guanguans\Notify\Messages\IGotMessage([
            'content' => 'This is content.',
            // 'title' => 'This is title.',
            // 'url' => 'https://www.github.com/guanguans/notify',
            // 'automaticallyCopy' => 1,
            // 'urgent' => 1,
            // 'copy' => 'This is copy.',
            // 'detail' => [
            //     'title' => 'This is detail title.',
            //     'content' => 'This is detail content.',
            // ],
        ])
    )
    ->send();
Logger
Factory::logger()
    ->setLogger(new \Psr\Log\NullLogger())
    // ->setLevel('warning')
    ->setMessage(new \Guanguans\Notify\Messages\LoggerMessage('This is a testing.'))
    ->send();
Mattermost
Factory::mattermost()
    ->setBaseUri('https://guanguans.cloud.mattermost.com')
    ->setToken('r7jezodttibgueijpahyyfh1qa')
    ->setMessage(
        new \Guanguans\Notify\Messages\MattermostMessage([
            'channel_id' => 'sat5ohbs5byixd86tmxtk13',
            'message' => 'This is a testing.',
            // 'is_pinned' => true,
            // 'create_at' => 1639041968509,
            // 'edit_at' => 1639041968509,
            // 'root_id' => '',
            // 'original_id' => '',
            // 'type' => '',
            // 'pending_post_id' => '1639041968509abc',
            // 'participants' => null,
            // 'props' => ['key' => 'value'],
            // 'file_ids' => ['o3x4y157jff5xydf5m91bft1oo'],
        ])
    )
    ->send();
Now Push
// Note Message
Factory::nowPush()
    ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL')
    ->setMessage(new \Guanguans\Notify\Messages\NowPush\NoteMessage('This is a note.'))
    ->send();

// Image Message
Factory::nowPush()
    ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL')
    ->setMessage(new \Guanguans\Notify\Messages\NowPush\ImageMessage('https://www.nowpush.app/assets/img/welcome/welcome-mockup.png'))
    ->send();

// Link Message
Factory::nowPush()
    ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL')
    ->setMessage(new \Guanguans\Notify\Messages\NowPush\LinkMessage('https://github.com/guanguans/notify'))
    ->send();

// User Info
Factory::nowPush()
    ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL')
    ->getUser();
PushBack
Factory::pushBack()
    ->setToken('at_uDCCK8gdHJPN613lASV')
    // ->setSynchonousMode()
    ->setMessage(
        new \Guanguans\Notify\Messages\PushBackMessage([
            'id' => 'User_1730',
            'title' => 'This is title.',
            // 'body' => 'This is body.',
            // 'action1' => 'action1',
            // 'action2' => 'action2',
            // 'reply' => 'reply',
        ])
    )
    ->send();
Push
Factory::push()
    ->setToken('5db80e8a-1f9b-4f98-929a-75892cedc')
    ->setMessage(
        new \Guanguans\Notify\Messages\PushMessage([
            'title' => 'This is a title.',
            'body' => 'This is a body.',
            // 'link' => 'https://github.com/guanguans/notify',
            // 'image' => 'https://www.nowpush.app/assets/img/welcome/welcome-mockup.png',
        ])
    )
    ->send();
PushDeer
Factory::pushDeer()
    ->setToken('PDU8024TTt9Yvx4wkm08SmSXAY9pnPycl5RrB')
    ->setMessage(new \Guanguans\Notify\Messages\PushDeerMessage('## This is text.', '> This is desp.', 'markdown'))
    ->send();
PushPlus
Factory::pushPlus()
    ->setToken('762e3f7efd764ad5acaa9cc26ac20')
    ->setMessage(new \Guanguans\Notify\Messages\PushPlusMessage([
        'content' => 'This is content.',
        // 'title' => 'This is title.',
        // 'template' => 'html',
        // 'topic' => 'topic',
    ]))
    ->send();
QQ 频道机器人
# 安装依赖
$ composer require textalk/websocket -vvv
// 获取用户频道列表
Factory::qqChannelBot()
    ->setAppid('102001')
    ->setToken('eghXYBXQH0QXBByb8Zj4VeRGterQG')
    ->getUserChannels();

// 获取子频道列表    
Factory::qqChannelBot()
    ->setAppid('102001')
    ->setToken('eghXYBXQH0QXBByb8Zj4VeRGterQG')
    ->getSubChannels(5099581822453968); // 频道 ID

// 发送频道消息
Factory::qqChannelBot()
    ->setAppid('102001')
    ->setToken('eghXYBXQH0QXBByb8Zj4VeRGterQG')
    ->setChannelId('4317') // 子频道 ID
    // ->sandboxEnvironment()
    // ->setSecret('3yfBSaUCfy3zlQr5')
    ->setMessage(
        \Guanguans\Notify\Messages\QqChannelBotMessage::create([
            'content' => 'This is content.',
            'image' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
            // 'msg_id' => '3yfBSa',
            // 'embed' => [],
            // 'ark' => [],
            // 'message_reference' => [],
            // 'markdown' => [],
        ])
    )
    ->send();
Rocket Chat
Factory::rocketChat()
    ->setToken('EemSHx9ioqdmrWouS/yYpmhqDSyd7CqmSAnyBfKezLyzotswbRSpkD9MCNxqtPL')
    ->setBaseUri('https://guanguans.rocket.chat')
    ->setMessage(
        new \Guanguans\Notify\Messages\RocketChatMessage([
            'alias' => '报警机器人',
            'emoji' => ':warning:',
            'text' => 'This is a testing. ',
            // 'attachments' => [
            //     [
            //         'title' => 'This is a title.',
            //         'title_link' => 'https://rocket.chat',
            //         'text' => 'This is a text.',
            //         'image_url' => 'http://www.xxx.png',
            //         'color' => '#764FA5',
            //     ],
            // ],
        ])
    )
    ->send();
Server 酱
Factory::serverChan()
    ->setToken('SCT35149Thtf1g2Bc14QJuQ6HFpW5YG')
    ->setMessage(new \Guanguans\Notify\Messages\ServerChanMessage('This is title.', 'This is desp.'))
    ->send();

// Check
Factory::serverChan()->check(3334849, 'SCTJlJV1J87hS');
Showdoc Push
Factory::showdocPush()
    ->setToken('f096edb95f92540219a41e47060eeb6d9461')
    ->setMessage(new \Guanguans\Notify\Messages\ShowdocPushMessage('This is title.', 'This is content.'))
    ->send();
Slack
$message = new \Guanguans\Notify\Messages\SlackMessage([
    'text' => 'This is text.',
    //'channel' => '#general',
    //'username' => 'notify bot',
    //'icon_emoji' => ':ghost:',
    //'icon_url' => 'https://avatars.githubusercontent.com/u/22309277?v=4',
    //'unfurl_links' => true,
    //'attachments' => $attachment = [
    //    'fallback' => 'Required text summary of the attachment',
    //    'text' => 'Optional text that should appear within the attachment',
    //    'pretext' => 'Optional text that should appear above the formatted data',
    //    'color' => '#36a64f',
    //    'fields' => [
    //        [
    //            'title' => 'Required Field Title',
    //            'value' => 'Text value of the field.',
    //            'short' => false,
    //        ],
    //    ],
    //],
]);

Factory::slack()
    ->setWebhookUrl('https://hooks.slack.com/services/TPU9A98MT/B038KNUC0GY/6pKH3vfa3mjlUPcgLSjzR')
    ->setMessage($message)
    ->send();
Telegram
// getUpdates(Chat ID)
Factory::telegram()
    ->setToken('5146570:AAF-Pi1MBPa46wdyobfZZdZL1-PlDfrZ')
    ->getUpdates();

// Text
\Guanguans\Notify\Messages\Telegram\TextMessage::create([
    'chat_id' => 50443416,
    'text' => '*This is text*',
    'parse_mode' => 'MarkdownV2',
    // 'entities' => [],
    // 'disable_web_page_preview' => true,
    // 'disable_notification' => true,
    // 'protect_content' => true,
    // 'reply_to_message_id' => 5,
    // 'allow_sending_without_reply' => true,
    // 'reply_markup' => [],
]);

Factory::telegram()
    ->setToken('5146570195:AAF-Pi1MBPa46wdyobfZZdZL')
    ->setMessage($message)
    ->send();
Webhook
$message = \Guanguans\Notify\Messages\WebhookMessage::create([
    'content' => 'This is content.',
    'username' => 'notify bot.',
])
// ->setHeaders(['Accept' => '*/*'])
// ->setQuery([['foo' => 'bar']])
->setVerify(false);

Factory::webhook()
    ->setUrl('https://discord.com/api/webhooks/955407924304425000/o7RfCGxek_o8kfR6Q9iGKtTdRJ')
    // ->setRequestMethod('postJson')
    ->setMessage($message)
    ->send();
企业微信群机器人
// Text Message
Factory::weWork()
    ->setToken('73a3d5a3-ceff-4da8-bcf3-ff5891778f')
    ->setMessage((new \Guanguans\Notify\Messages\WeWork\TextMessage([
        'content'               => 'This is content.',
        // 'mentioned_list'        => ["wangqing", "@all"],
        // 'mentioned_mobile_list' => ["13800001111", "@all"],
    ])))
    ->send();

// Markdown Message
Factory::weWork()
    ->setToken('73a3d5a3-ceff-4da8-bcf3-ff5891778f')
    ->setMessage(new \Guanguans\Notify\Messages\WeWork\MarkdownMessage("# This is title.\n This is content."))
    ->send();

// Image Message
Factory::weWork()
    ->setToken('73a3d5a3-ceff-4da8-bcf3-ff5891778f')
    ->setMessage(new \Guanguans\Notify\Messages\WeWork\ImageMessage('https://avatars.githubusercontent.com/u/22309277?v=4'))
    ->send();

// News Message
$message = new \Guanguans\Notify\Messages\WeWork\NewsMessage([
    'title'       => 'This is title1.',
    'description' => 'This is description.',
    'url'         => 'https://github.com/guanguans/notify',
    'picurl'      => 'https://avatars.githubusercontent.com/u/22309277?v=4',
]);
$message->addArticle([
    'title'       => 'This is title2.',
    'description' => 'This is description.',
    'url'         => 'https://github.com/guanguans/notify',
    'picurl'      => 'https://avatars.githubusercontent.com/u/22309277?v=4',
]);
Factory::weWork()
    ->setToken('73a3d5a3-ceff-4da8-bcf3-ff5891778f')
    ->setMessage($message)
    ->send();
息知
// Single
Factory::xiZhi()
    // ->setType('single')
    ->setToken('XZd60aea56567ae39a1b1920cbc42bb5')
    ->setMessage(new \Guanguans\Notify\Messages\XiZhiMessage('This is title.', 'This is content.'))
    ->send();

// Channel
Factory::xiZhi()
    ->setType('channel')
    ->setToken('XZ8da15b55a6725497232d87298bcd34')
    ->setMessage(new \Guanguans\Notify\Messages\XiZhiMessage('This is title.', 'This is content.'))
    ->send();
Zulip
// Private Message
Factory::zulip()
    ->setToken('Mc0b7YBmibOVjLdk7KKSpT9SJLi1h')
    ->setEmail('[email protected]')
    ->setBaseUri('https://coole.zulipchat.com')
    ->setMessage(new \Guanguans\Notify\Messages\Zulip\PrivateMessage('[email protected]', 'This is testing.'))
    ->send();

// Stream Message
Factory::zulip()
    ->setToken('Mc0b7YBmibOVjLdk7KKSpT9SJLi1h')
    ->setEmail('[email protected]')
    ->setBaseUri('https://coole.zulipchat.com')
    ->setMessage(new \Guanguans\Notify\Messages\Zulip\StreamMessage([
        'to' => 'coole',
        'content' => 'This is testing.',
        'topic' => 'bug',
        //'queue_id' => '1593114627:0',
        //'local_id' => '100.01',
    ]))
    ->send();

测试

$ composer test

变更日志

请参阅 CHANGELOG 获取最近有关更改的更多信息。

贡献指南

请参阅 CONTRIBUTING 有关详细信息。

安全漏洞

请查看我们的安全政策了解如何报告安全漏洞。

贡献者

协议

MIT 许可证(MIT)。有关更多信息,请参见协议文件

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].