Skip to content

Commit e861d86

Browse files
author
王允
committed
支持接入微信
1 parent 845ebf4 commit e861d86

9 files changed

Lines changed: 573 additions & 27 deletions

File tree

README.md

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ OpenClaw plugin for fetching GitHub trending repositories and pushing to Feishu
1111

1212
- 🔥 **GitHub Trending** — Fetch trending repositories for today, this week, or this month
1313
- 🤖 **AI Summaries** — Generate intelligent summaries using OpenAI or Anthropic
14-
- 📢 **Multi-Channel Push** — Support Feishu and Email notifications
14+
- 📢 **Multi-Channel Push** — Support Feishu, Email, and WeChat notifications
1515
- 🔄 **Smart Deduplication** — Track repository history and re-push on significant star growth
1616
-**Scheduled Tasks** — Integrate with OpenClaw's task scheduler for automated updates
1717

@@ -86,7 +86,7 @@ This configuration tells OpenClaw to trust and allow loading this plugin. After
8686
"max_workers": 5,
8787
// Optional: GitHub personal access token. Frequent calls may trigger rate limits, configuring this can avoid GitHub rate limits. Not recommended as this plugin is not called frequently.
8888
"github_token": "xxx",
89-
// Required: Configure at least one channel (Feishu or Email), otherwise you won't receive notifications.
89+
// Required: Configure at least one channel (Feishu, Email, or WeChat), otherwise you won't receive notifications.
9090
"channels": {
9191
"feishu": {
9292
"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
@@ -97,6 +97,9 @@ This configuration tells OpenClaw to trust and allow loading this plugin. After
9797
"sender": "xxx@qq.com",
9898
"password": "xxx",
9999
"recipient": "yyy@qq.com"
100+
},
101+
"wechat": {
102+
"enabled": true
100103
}
101104
},
102105
// Optional: Enable history tracking for smart deduplication
@@ -175,7 +178,7 @@ openclaw gen-cron <mode> <since> <channels>
175178
|-----------|-------------|---------|
176179
| `mode` | Execution mode: `now` for immediate execution, or Cron expression (format: minute hour day month weekday) | `now`<br>`"0 10 * * 3"` |
177180
| `since` | Trending period: `daily` (today), `weekly` (this week), `monthly` (this month) | `daily` |
178-
| `channels` | Push channels: `email`, `feishu`, or `email,feishu` (multiple channels separated by comma) | `feishu`<br>`email,feishu` |
181+
| `channels` | Push channels: `email`, `feishu`, `wechat`, or `email,feishu,wechat` (multiple channels separated by comma) | `feishu`<br>`email,feishu,wechat` |
179182
180183
**Cron Expression Format:**
181184
- Format: `minute(0-59) hour(0-23) day(1-31) month(1-12) weekday(0-7, 0 and 7 are Sunday)`
@@ -237,13 +240,19 @@ Use the openclaw-github-trending tool to help me create a scheduled task that pu
237240
// Multi-Channel Push
238241
- "Use the openclaw-github-trending tool to help me create a task to push daily trending to both Feishu and email every day at 8:00"
239242
- "I want to use the openclaw-github-trending tool to receive trending every day at 10:00, sent to both Feishu and my email"
243+
244+
// WeChat Push
245+
- "Use the openclaw-github-trending tool to help me create a task to push GitHub daily trending to my WeChat every morning at 8:00"
246+
- "I want to use the openclaw-github-trending tool to receive weekly trending in my WeChat every Friday at 18:00"
247+
- "Use the openclaw-github-trending tool to create a scheduled task: fetch monthly trending every 1st day at 9:00 AM and push to WeChat"
248+
- "Use the openclaw-github-trending tool to help me create a task to push trending to Feishu, email, and WeChat every day at 10:00"
240249
```
241250

242251
**Intelligent Parsing Capabilities:**
243252

244253
**Time Recognition**: Automatically parses time expressions like "every day at 8:00", "every Monday at 10:00", "1st of every month at 9:00"
245254
**Period Recognition**: Automatically identifies "today/daily"→`daily`, "this week/weekly"→`weekly`, "monthly"→`monthly`
246-
**Channel Recognition**: Automatically identifies "email"→`email`, "feishu"→`feishu`, "feishu and email"→`["feishu","email"]`
255+
**Channel Recognition**: Automatically identifies "email"→`email`, "feishu"→`feishu`, "wechat"→`wechat`, "feishu and email"→`["feishu","email"]`, "feishu, email, and wechat"→`["feishu","email","wechat"]`
247256
**Task Creation**: Automatically generates appropriate Cron expressions and creates scheduled tasks
248257

249258
**Execution Flow:**
@@ -362,6 +371,72 @@ The plugin supports OpenAI-compatible API providers. If not configured in the pl
362371
| `from_name` | string | No | `"GitHub Trending"` | Display name for sender |
363372
| `timeout` | number | No | `30` | SMTP connection timeout in seconds |
364373

374+
#### WeChat
375+
376+
| Field | Type | Required | Default | Description |
377+
|-------|------|----------|---------|-------------|
378+
| `enabled` | boolean | No | `false` | Enable WeChat notifications via @tencent-weixin/openclaw-weixin plugin |
379+
| `receiver_id` | string | No | - | WeChat receiver ID (format: `xxx@im.wechat`) |
380+
| `bot_account_id` | string | No | - | WeChat bot account ID (format: `xxx-im-bot`) |
381+
382+
**WeChat Requirements:**
383+
384+
1. **Install WeChat Plugin**:
385+
```bash
386+
npm install @tencent-weixin/openclaw-weixin
387+
```
388+
389+
2. **Configure in OpenClaw** (`~/.openclaw/openclaw.json`):
390+
```json
391+
{
392+
"plugins": {
393+
"entries": {
394+
"@tencent-weixin/openclaw-weixin": {
395+
"enabled": true,
396+
"config": {
397+
"enable_login": true
398+
}
399+
},
400+
"openclaw-github-trending": {
401+
"enabled": true,
402+
"config": {
403+
"channels": {
404+
"wechat": {
405+
"enabled": true,
406+
"receiver_id": "xxx@im.wechat",
407+
"bot_account_id": "xxx-im-bot"
408+
}
409+
}
410+
}
411+
}
412+
}
413+
}
414+
}
415+
```
416+
417+
3. **Configuration Options (choose one)**:
418+
- **Config File (Recommended)**: Set `receiver_id` and `bot_account_id` in the `wechat` section of `openclaw.json`
419+
- **Environment Variables**: Set `OPENCLAW_WECHAT_RECEIVER_ID` and `OPENCLAW_WECHAT_BOT_ACCOUNT_ID`
420+
- **Default Values**: Use built-in default configuration (for testing only)
421+
422+
4. **Login to WeChat**:
423+
- OpenClaw will prompt you to scan QR code with your personal WeChat
424+
- After login, messages will be sent to the configured WeChat account
425+
426+
5. **Usage**:
427+
```bash
428+
# Send to WeChat
429+
openclaw gen-cron now daily wechat
430+
431+
# Send to multiple channels including WeChat
432+
openclaw gen-cron now daily email,feishu,wechat
433+
```
434+
435+
**Notes:**
436+
- WeChat notifications are sent as markdown messages to your personal WeChat account
437+
- Messages include new repositories (with full AI summaries) and trending repositories (with brief summaries)
438+
- If the WeChat plugin is not installed or configured, the plugin will show a warning but continue with other channels
439+
365440
*Required when using this channel
366441

367442
### History Configuration

README_CN.md

Lines changed: 82 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ OpenClaw 插件,用于获取 GitHub 趋势仓库并通过 AI 生成的摘要
1111

1212
- 🔥 **GitHub 热榜** — 获取今日、本周或本月热榜项目
1313
- 🤖 **AI 摘要** — 使用 OpenAI 或 Anthropic 生成智能摘要
14-
- 📢 **多渠道推送**支持飞书和邮件通知
14+
- 📢 **多渠道推送**支持飞书、邮件和微信通知
1515
- 🔄 **智能去重** — 追踪仓库历史,在 Star 大幅增长时重新推送
1616
-**定时任务** — 与 OpenClaw 任务调度器集成,实现自动化更新
1717

@@ -86,7 +86,7 @@ openclaw plugins install openclaw-github-trending
8686
"max_workers": 5,
8787
// 可选:GitHub 个人访问令牌,频繁调用可能会限制访问,配置后基本上可以避免触发 GitHub 速率限制。不建议配置,因为本身这个插件的调用频率也不高。
8888
"github_token": "xxx",
89-
// 必须:配置一个通道(飞书或邮件),否则无法通知到你。
89+
// 必须:配置一个通道(飞书、邮件或微信),否则无法通知到你。
9090
"channels": {
9191
"feishu": {
9292
"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
@@ -97,6 +97,11 @@ openclaw plugins install openclaw-github-trending
9797
"sender": "xxx@qq.com",
9898
"password": "xxx",
9999
"recipient": "yyy@qq.com"
100+
},
101+
"wechat": {
102+
"enabled": true,
103+
"receiver_id":"your-wechat-user-id@imwechat", // 微信用户 id
104+
"bot_account_id": "your-bot-account-id-im-bot" // 微信机器人账号 id
100105
}
101106
},
102107
// 可选:开启历史记录功能,用于智能去重
@@ -176,7 +181,7 @@ openclaw gen-cron <mode> <since> <channels>
176181
|------|------|------|
177182
| `mode` | 执行模式:`now` 表示立即执行,或 Cron 表达式(格式:分 时 日 月 周) | `now` <br> `"0 10 * * 3"` |
178183
| `since` | 热榜周期:`daily`(今日)、`weekly`(本周)、`monthly`(本月) | `daily` |
179-
| `channels` | 推送渠道:`email`、`feishu` 或 `email,feishu`(多个渠道用逗号分隔) | `email,feishu` |
184+
| `channels` | 推送渠道:`email`、`feishu`、`wechat` 或 `email,feishu,wechat`(多个渠道用逗号分隔) | `email,feishu,wechat` |
180185
181186
**Cron 表达式格式:**
182187
- 格式:`分(0-59) 时(0-23) 日(1-31) 月(1-12) 周(0-7, 0和7都是周日)`
@@ -237,14 +242,20 @@ openclaw cron add --name "GitHub 热榜 每周 飞书+邮箱" \
237242
238243
// 多渠道推送
239244
- "使用openclaw-github-trending工具,帮我创建每天 8:00 推送今日热榜到飞书和邮箱的任务"
240-
- "我想使用openclaw-github-trending工具,每天 10:00 收到热榜,同时发到飞书和我的邮箱"
245+
- "我想使用openclaw-github-trending工具,每天 10:00 收到热榜,同时发到飞书和我的邮箱"
246+
247+
// 微信推送
248+
- "使用openclaw-github-trending工具,帮我创建每天 8:00 推送今日热榜到微信的任务"
249+
- "我想使用openclaw-github-trending工具,每周五 18:00 收到本周热榜,发到我的微信"
250+
- "使用openclaw-github-trending工具,帮我创建每月 1 号 9:00 推送月榜到微信的任务"
251+
- "使用openclaw-github-trending工具,帮我创建每天 10:00 推送热榜到飞书、邮箱和微信的任务"
241252
```
242253

243254
**智能解析能力:**
244255

245256
**时间识别**:自动解析"每天 8:00"、"每周一 10:00"、"每月 1 号 9:00"等时间表达
246257
**周期识别**:自动识别"今日/每天"→`daily`、"本周/每周"→`weekly`、"月榜/每月"→`monthly`
247-
**渠道识别**:自动识别"邮箱"→`email`、"飞书"→`feishu`、"飞书和邮箱"→`["feishu","email"]`
258+
**渠道识别**:自动识别"邮箱"→`email`、"飞书"→`feishu`、"微信"→`wechat`、"飞书和邮箱"→`["feishu","email"]`、"飞书、邮箱和微信"→`["feishu","email","wechat"]`
248259
**任务创建**:自动生成合适的 Cron 表达式并创建定时任务
249260

250261
**执行流程:**
@@ -363,6 +374,72 @@ openclaw cron rm <job-id>
363374
| `from_name` | string || `"GitHub Trending"` | 发件人显示名称 |
364375
| `timeout` | number || `30` | SMTP 连接超时时间(秒) |
365376

377+
#### 微信
378+
379+
| 字段 | 类型 | 必填 | 默认值 | 说明 |
380+
|-------|------|----------|---------|-------------|
381+
| `enabled` | boolean || `false` | 通过 @tencent-weixin/openclaw-weixin 插件启用微信通知 |
382+
| `receiver_id` | string || - | 微信接收者 ID(格式:`xxx@im.wechat`|
383+
| `bot_account_id` | string || - | 微信机器人账号 ID(格式:`xxx-im-bot`|
384+
385+
**微信推送配置要求:**
386+
387+
1. **安装微信插件**
388+
```bash
389+
npm install @tencent-weixin/openclaw-weixin
390+
```
391+
392+
2. **在 OpenClaw 中配置** (`~/.openclaw/openclaw.json`):
393+
```json
394+
{
395+
"plugins": {
396+
"entries": {
397+
"@tencent-weixin/openclaw-weixin": {
398+
"enabled": true,
399+
"config": {
400+
"enable_login": true
401+
}
402+
},
403+
"openclaw-github-trending": {
404+
"enabled": true,
405+
"config": {
406+
"channels": {
407+
"wechat": {
408+
"enabled": true,
409+
"receiver_id": "xxx@im.wechat",
410+
"bot_account_id": "xxx-im-bot"
411+
}
412+
}
413+
}
414+
}
415+
}
416+
}
417+
}
418+
```
419+
420+
3. **配置方式(三选一)**
421+
- **配置文件(推荐)**:在 `openclaw.json``wechat` 配置中设置 `receiver_id``bot_account_id`
422+
- **环境变量**:设置 `OPENCLAW_WECHAT_RECEIVER_ID``OPENCLAW_WECHAT_BOT_ACCOUNT_ID`
423+
- **默认值**:使用内置默认配置(仅用于测试)
424+
425+
4. **登录微信**
426+
- OpenClaw 会提示您使用个人微信扫描二维码
427+
- 登录后,消息将发送到配置的微信账号
428+
429+
5. **使用方法**
430+
```bash
431+
# 发送到微信
432+
openclaw gen-cron now daily wechat
433+
434+
# 同时发送到多个渠道包括微信
435+
openclaw gen-cron now daily email,feishu,wechat
436+
```
437+
438+
**注意事项:**
439+
- 微信通知以 Markdown 格式发送到您的个人微信账号
440+
- 消息包含新项目(完整 AI 摘要)和持续霸榜项目(简要摘要)
441+
- 如果微信插件未安装或未配置,插件会显示警告但继续向其他渠道推送
442+
366443
*使用该渠道时必填
367444

368445
### 历史记录配置

openclaw.plugin.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "openclaw-github-trending",
33
"name": "GitHub Trending",
4-
"version": "1.3.1",
4+
"version": "1.4.0",
55
"description": "Fetch GitHub trending repositories and push to Feishu or Email with AI summaries",
66
"author": "王允",
77
"license": "MIT",
@@ -106,6 +106,26 @@
106106
}
107107
},
108108
"required": ["sender", "password"]
109+
},
110+
"wechat": {
111+
"type": "object",
112+
"description": "WeChat channel configuration (requires @tencent-weixin/openclaw-weixin plugin)",
113+
"properties": {
114+
"enabled": {
115+
"type": "boolean",
116+
"default": false,
117+
"description": "Enable WeChat notifications via openclaw-weixin plugin"
118+
},
119+
"receiver_id": {
120+
"type": "string",
121+
"description": "WeChat user ID to receive messages"
122+
},
123+
"bot_account_id": {
124+
"type": "string",
125+
"description": "WeChat bot account ID"
126+
}
127+
},
128+
"additionalProperties": false
109129
}
110130
}
111131
},

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openclaw-github-trending",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "OpenClaw plugin for fetching GitHub trending repositories and pushing to Feishu or Email with AI summaries",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)