PHPackages                             angel-project/wechat - 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. angel-project/wechat

ActiveLibrary

angel-project/wechat
====================

WeChat plugin.

v0.0.2(7y ago)038MITPHP

Since Jun 15Pushed 7y agoCompare

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

READMEChangelog (2)DependenciesVersions (3)Used By (0)

[![](https://camo.githubusercontent.com/fff9aeab589f7d97cf6a56dfc0ff9e5462a8c5bc3aa1302a53cb1c82d1444145/68747470733a2f2f78792e7a756767722e636f6d2f66696c652f616e67656c5f7765636861742e6a7067)](https://camo.githubusercontent.com/fff9aeab589f7d97cf6a56dfc0ff9e5462a8c5bc3aa1302a53cb1c82d1444145/68747470733a2f2f78792e7a756767722e636f6d2f66696c652f616e67656c5f7765636861742e6a7067)

中文档案
----

[](#中文档案)

**Angel微信** 是基于[**Angel框架**](https://github.com/angel-project/framework)的公众号开发框架

安装
--

[](#安装)

请先使用Composer安装[**Angel框架**](https://github.com/angel-project/framework):

```
composer create-project angel-project/framework .

```

然后安装微信拓展:

```
composer require angel-project/wechat

```

[![GitHub php](https://camo.githubusercontent.com/754039e2dfe298e39a6cb74c56f9c9191d53755a6df3f0c7033c998d938c0099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73796d666f6e792f73796d666f6e792e737667)](https://camo.githubusercontent.com/754039e2dfe298e39a6cb74c56f9c9191d53755a6df3f0c7033c998d938c0099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73796d666f6e792f73796d666f6e792e737667)[![GitHub license](https://camo.githubusercontent.com/e613ab3c2d83fd60009d0a4f2d2a7493048d63e7ddf28730e2825721b80bf7aa/68747470733a2f2f696d672e736869656c64732e696f2f636f636f61706f64732f6c2f41464e6574776f726b696e672e737667)](https://camo.githubusercontent.com/e613ab3c2d83fd60009d0a4f2d2a7493048d63e7ddf28730e2825721b80bf7aa/68747470733a2f2f696d672e736869656c64732e696f2f636f636f61706f64732f6c2f41464e6574776f726b696e672e737667)

公众号开发
-----

[](#公众号开发)

一个基本的监听/反馈模板：

```
  build::post('your/url',function(){

    $wx = new angel\wechat($appid,$secret,$token); //初始化微信object

    $wx->listen('text','hi',function($input,$wx){
      $wx->return('text',[
        'to' => $input->FromUserName,
        'content' => 'hello!'
      ]);
    }); //当用户输入hi时，返回字符串hello!

    $wx->listen('event','subscribe',function($input,$wx){
      $wx->return('news',[
        'to' => $input->FromUserName,
        'articles' => [[
          'title' => 'hi!',
          'description' => 'long time no see',
          'picurl' => 'yoururl.com/img.jpg',
          'url' => 'yoururl.com'
        ]]
      ]); //返回主题
    }); //当用户关注时触发，返回图文消息

    $wx->run(); //执行监听

  });
```

listen()方法有三个输入：

- 监听方法：目前支持text（文字输入）、event（事件触发）
- 触发事件：文字支持字符串和正则表达式匹配，事件支持SCAN（扫码）、subscribe（关注）、CLICK（点击）触发。当用户输入不满足任何规则时，当触发事件为'empty'。
- 触发后执行的代码：该function输入两个值：用户输入和微信object。你可以通过用户输入来获取所有用户传送至服务器的指令；微信object让你在function继续自由使用微信方法。

创建菜单
----

[](#创建菜单)

```
  $wx = new angel\wechat($appid,$secret,$token); //初始化微信object

  $menu = [[
    'type' => 'click',
    'name' => '欢迎光临',
    'key' => 'welcome'
  ]]; //生成一个click时间菜单，具体创建菜单指令请参考微信开发者档案

  $at = $wx->access_token();  //获取access token
  $wx->menu($at,$menu); //生成菜单
```

English Doc
-----------

[](#english-doc)

**Angel WeChat** is a WeChat plugin based on [**Angel Framework**](https://github.com/angel-project/framework)

Installation
------------

[](#installation)

First, **install** [**Angel Framework**](https://github.com/angel-project/framework) with Composer using the following command:

```
composer create-project angel-project/framework .

```

Then, **install** Angel WeChat package:

```
composer require angel-project/wechat

```

[![GitHub php](https://camo.githubusercontent.com/754039e2dfe298e39a6cb74c56f9c9191d53755a6df3f0c7033c998d938c0099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73796d666f6e792f73796d666f6e792e737667)](https://camo.githubusercontent.com/754039e2dfe298e39a6cb74c56f9c9191d53755a6df3f0c7033c998d938c0099/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73796d666f6e792f73796d666f6e792e737667)[![GitHub license](https://camo.githubusercontent.com/e613ab3c2d83fd60009d0a4f2d2a7493048d63e7ddf28730e2825721b80bf7aa/68747470733a2f2f696d672e736869656c64732e696f2f636f636f61706f64732f6c2f41464e6574776f726b696e672e737667)](https://camo.githubusercontent.com/e613ab3c2d83fd60009d0a4f2d2a7493048d63e7ddf28730e2825721b80bf7aa/68747470733a2f2f696d672e736869656c64732e696f2f636f636f61706f64732f6c2f41464e6574776f726b696e672e737667)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

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

Every ~123 days

Total

2

Last Release

2765d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e683549a5b4521960d503c26a8acb83605f2b37d019d82ca088616f9840bea22?d=identicon)[ZimoTheDragon](/maintainers/ZimoTheDragon)

---

Top Contributors

[![zimo-xiao](https://avatars.githubusercontent.com/u/34933627?v=4)](https://github.com/zimo-xiao "zimo-xiao (26 commits)")

### Embed Badge

![Health badge](/badges/angel-project-wechat/health.svg)

```
[![Health](https://phpackages.com/badges/angel-project-wechat/health.svg)](https://phpackages.com/packages/angel-project-wechat)
```

PHPackages © 2026

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