PHPackages                             fanly/msgrobot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fanly/msgrobot

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fanly/msgrobot
==============

message robot to dingding or others

0.0.1(8y ago)2161MITPHP

Since Feb 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/fanly/msgrobot)[ Packagist](https://packagist.org/packages/fanly/msgrobot)[ RSS](/packages/fanly-msgrobot/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

我们选择利用 Lumen 项目试试，安装插件

[![](https://camo.githubusercontent.com/b3a202ba71b57a70fb9f32c184f258587a3814b7c8a51c0ad6db9c420c448e3d/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313936323230303933302e6a7067)](https://camo.githubusercontent.com/b3a202ba71b57a70fb9f32c184f258587a3814b7c8a51c0ad6db9c420c448e3d/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313936323230303933302e6a7067)

在 bootstrap/app.php 引入注册插件 ServiceProvider：

```
$app->register(Fanly\Msgrobot\FanlyMsgrobotServiceProvider::class);

```

我们写一个 test，试试效果，先创建独立跳转 ActionCard 类型消息，然后给已创建的机器人对应的「access\_token」钉钉群推送此消息

```
// text
        $text = new Text('hello fanly/msgrobot package');
        Msgrobot::accessToken('cb36a3c3cab1242b94516d026a02d909f1611ec048d89c93cb3e1132f08b4e')
            ->message($text)
            ->send();

        // link
        $link = new Link([
            'text' => 'link text',
            'title' => 'link title',
            'picUrl' => 'http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg',
            'messageUrl' => 'http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg'
        ]);
        Msgrobot::accessToken('cb36a3c3cab1242b94516d026a02d909f1611ec048d89c93cb3e1132f08b4e')
            ->message($link)
            ->send();

        // markdown
        $md = new Markdown([
            'title' => 'link text',
            'text' => "#### 杭州天气 @156xxxx8827\n > 9度，西北风1级，空气良89，相对温度73%\n\n> ![screenshot](http://image.jpg)\n> ###### 10点20分发布 [天气](http://www.thinkpage.cn/) \n"
        ]);

        Msgrobot::accessToken('cb36a3c3cab1242b94516d026a02d909f1611ec048d89c93cb3e1132f08b4e')
            ->message($md)
            ->send();

        // Single ActionCard
        $sac = new SingleActionCard([
            'title' => 'link title',
            'text' => '![screenshot](@lADOpwk3K80C0M0FoA)
 ### 乔布斯 20 年前想打造的苹果咖啡厅
 Apple Store 的设计正从原来满满的科技感走向生活化，而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划',
            'hideAvatar' => 0,
            'btnOrientation' => 0,
            'singleTitle' => '阅读原文',
            'singleURL' => 'http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg'
        ]);

        Msgrobot::accessToken('cb36a3c3cab1242b94516d026a02d909f1611ec048d89c93cb3e1132f08b4e')
            ->message($sac)
            ->send();

        // More ActionCard
        $btns = [
            new ActionCardBtn([
                'title' => '内容不错',
                'actionURL' => 'http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg'
            ]),
            new ActionCardBtn([
                'title' => '不感兴趣',
                'actionURL' => 'http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg'
            ])
        ];

        $mac = new MoreActionCard([
            'title' => 'link title',
            'text' => '![screenshot](@lADOpwk3K80C0M0FoA)
 ### 乔布斯 20 年前想打造的苹果咖啡厅
 Apple Store 的设计正从原来满满的科技感走向生活化，而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划',
            'hideAvatar' => 0,
            'btnOrientation' => 0,
            'btns' => $btns
        ]);

        Msgrobot::accessToken('cb36a3c3cab1242b94516d026a02d909f1611ec048d89c93cb3e1132f08b4e')
            ->message($mac)
            ->send();

        // FeedCard
        $links = [
            new FeedCardLink([
                'title' => "时代的火车向前开",
                "messageURL" => "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
                "picURL" => "http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg"
            ]),
            new FeedCardLink([
                'title' => "时代的火车向前开",
                "messageURL" => "https://mp.weixin.qq.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI",
                "picURL" => "http://f.hiphotos.baidu.com/image/pic/item/503d269759ee3d6db032f61b48166d224e4ade6e.jpg"
            ])
        ];

        $fc = new FeedCard($links);

        Msgrobot::accessToken('cb36a3c3cab1242b94516d026a02d909f1611ec048d89c93cb3e1132f08b4e')
            ->message($fc)
            ->send();
```

[![](https://camo.githubusercontent.com/ad233f2c16e483706d4e1286ec8916d5028ba869d13232aacd299f226f7c1a20/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937323739323739302e6a7067)](https://camo.githubusercontent.com/ad233f2c16e483706d4e1286ec8916d5028ba869d13232aacd299f226f7c1a20/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937323739323739302e6a7067)

[![](https://camo.githubusercontent.com/5218084510a982636804e5975888cc83cf39a6abd1f2fc4046240a8e04a178cc/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937333138393634362e6a7067)](https://camo.githubusercontent.com/5218084510a982636804e5975888cc83cf39a6abd1f2fc4046240a8e04a178cc/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937333138393634362e6a7067)

[![](https://camo.githubusercontent.com/0911d78f29c2dd69a5de41771efd082b106cec6ad11f63768c5e56ff01d5a498/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937333438323731312e6a7067)](https://camo.githubusercontent.com/0911d78f29c2dd69a5de41771efd082b106cec6ad11f63768c5e56ff01d5a498/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937333438323731312e6a7067)

[![](https://camo.githubusercontent.com/130ba99efeb0c55716cf3098a76a20217d9dff09946a56c3fa70925ba86f406e/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937333735313039382e6a7067)](https://camo.githubusercontent.com/130ba99efeb0c55716cf3098a76a20217d9dff09946a56c3fa70925ba86f406e/687474703a2f2f6f773230673474676a2e626b742e636c6f7564646e2e636f6d2f323031382d30322d32312d31353139313937333735313039382e6a7067)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3005d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/234dfb1192bac971cbebec5828b3b1241afed4a035bd159e606c4661bcdd8a69?d=identicon)[fanly](/maintainers/fanly)

---

Top Contributors

[![fanly](https://avatars.githubusercontent.com/u/1321825?v=4)](https://github.com/fanly "fanly (1 commits)")

### Embed Badge

![Health badge](/badges/fanly-msgrobot/health.svg)

```
[![Health](https://phpackages.com/badges/fanly-msgrobot/health.svg)](https://phpackages.com/packages/fanly-msgrobot)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
