
Security News
US Government Forces Anthropic to Pull Claude Fable Days After Launch
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.
@openclaw-china/wechat-mp
Advanced tools
wechat-mp 是一个独立的微信公众号(订阅号 / 服务号)渠道插件,用于把公众号消息接入 OpenClaw。
| 消息类型 | 支持状态 | 说明 |
|---|---|---|
| 文本消息 | ✅ | 完整支持,自动处理超长分割 |
| 图片消息 | ✅ | 返回图片 URL 和 MediaId |
| 语音消息 | ✅ | 支持 ASR 自动转文字 |
| 视频消息 | ✅ | 返回视频 MediaId |
| 短视频消息 | ✅ | 返回短视频 MediaId |
| 位置消息 | ✅ | 返回经纬度和地址 |
| 链接消息 | ✅ | 返回标题、描述和 URL |
| 事件消息 | ✅ | subscribe/unsubscribe/scan/click/view |
| 发送类型 | 支持状态 | 说明 |
|---|---|---|
| 文本消息 | ✅ | 支持超长自动分割 |
| 模板消息 | ✅ | 业务通知消息 |
| 图片消息 | ✅ | 自动上传并发送 |
| 语音消息 | ✅ | 自动上传并发送 |
| 视频消息 | ✅ | 自动上传并发送 |
{
"channels": {
"wechat-mp": {
"enabled": true,
"webhookPath": "/wechat-mp",
"appId": "wx1234567890abcdef",
"appSecret": "your-app-secret",
"token": "your-callback-token",
"encodingAESKey": "your-43-char-encoding-aes-key",
"messageMode": "safe",
"replyMode": "active",
"activeDeliveryMode": "split",
"renderMarkdown": true,
"welcomeText": "你好,欢迎关注。"
}
}
}
{
"channels": {
"wechat-mp": {
"enabled": true,
"webhookPath": "/wechat-mp",
"appId": "wx1234567890abcdef",
"appSecret": "your-app-secret",
"token": "your-callback-token",
"encodingAESKey": "your-43-char-encoding-aes-key",
"messageMode": "safe",
"replyMode": "active",
"activeDeliveryMode": "split",
"renderMarkdown": true,
"welcomeText": "你好,欢迎关注。",
"dmPolicy": "open",
"allowFrom": [],
"retryConfig": {
"maxRetries": 3,
"initialDelay": 1000,
"maxDelay": 10000,
"backoffMultiplier": 2
},
"asr": {
"enabled": true,
"appId": "腾讯云 AppId",
"secretId": "腾讯云 SecretId",
"secretKey": "腾讯云 SecretKey",
"engineType": "16k_zh",
"timeoutMs": 30000
}
}
}
}
{
"channels": {
"wechat-mp": {
"defaultAccount": "main",
"accounts": {
"main": {
"appId": "wx-main-account",
"appSecret": "main-secret",
"token": "main-token"
},
"sub": {
"appId": "wx-sub-account",
"appSecret": "sub-secret",
"token": "sub-token"
}
}
}
}
}
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
enabled | boolean | 否 | 是否启用,默认 true |
webhookPath | string | 否 | 回调路径,默认 /wechat-mp |
appId | string | 是 | 公众号 AppId |
appSecret | string | 条件 | 主动发送必填 |
token | string | 是 | 回调 Token |
encodingAESKey | string | 条件 | safe/compat 模式必填 |
messageMode | string | 否 | 消息模式:plain / safe / compat |
replyMode | string | 否 | 回复模式:passive / active |
activeDeliveryMode | string | 否 | 主动发送模式:split / merged |
renderMarkdown | boolean | 否 | 是否渲染 Markdown,默认 true |
welcomeText | string | 否 | 关注欢迎语 |
dmPolicy | string | 否 | DM 策略:open / pairing / allowlist / disabled |
allowFrom | string[] | 否 | 允许的用户列表 |
retryConfig)| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
maxRetries | number | 3 | 最大重试次数 |
initialDelay | number | 1000 | 初始延迟(毫秒) |
maxDelay | number | 10000 | 最大延迟(毫秒) |
backoffMultiplier | number | 2 | 退避乘数 |
asr)| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
enabled | boolean | 否 | 是否启用 ASR |
appId | string | 是 | 腾讯云 AppId |
secretId | string | 是 | 腾讯云 SecretId |
secretKey | string | 是 | 腾讯云 SecretKey |
engineType | string | 否 | 引擎类型,默认 16k_zh |
timeoutMs | number | 否 | 超时时间,默认 30000 |
import { wechatMpOutbound } from "@openclaw-china/wechat-mp";
// 发送文本
await wechatMpOutbound.sendText({
cfg,
to: "user:openid123",
text: "Hello, World!"
});
await wechatMpOutbound.sendTemplate({
cfg,
to: "user:openid123",
templateId: "template_id_here",
data: {
first: { value: "您好,您有新的通知" },
keyword1: { value: "订单号:123456" },
keyword2: { value: "已发货" },
remark: { value: "点击查看详情" }
},
url: "https://example.com/order/123456"
});
import { readFileSync } from "fs";
// 发送图片
await wechatMpOutbound.sendMedia({
cfg,
to: "user:openid123",
mediaType: "image",
buffer: readFileSync("./image.jpg"),
filename: "image.jpg"
});
// 发送语音
await wechatMpOutbound.sendMedia({
cfg,
to: "user:openid123",
mediaType: "voice",
buffer: readFileSync("./voice.amr"),
filename: "voice.amr"
});
// 发送视频
await wechatMpOutbound.sendMedia({
cfg,
to: "user:openid123",
mediaType: "video",
buffer: readFileSync("./video.mp4"),
filename: "video.mp4"
});
// 检查用户是否在 48 小时交互窗口内
const capability = await wechatMpOutbound.checkCapability({
cfg,
to: "user:openid123"
});
if (!capability.canSend) {
console.log(`无法发送:${capability.reason}`);
}
// 检查时间窗口
const inWindow = wechatMpOutbound.checkTimeWindow({
config: { mode: "business" } // 工作时间 9:00-18:00
});
// 在处理入站消息时调用,用于 48 小时窗口跟踪
await wechatMpOutbound.recordInteraction({
cfg,
openId: "openid123"
});
plain:明文模式,最小链路验证safe:加密模式,需要 encodingAESKeycompat:兼容模式,同时支持明文和加密appSecretpassive:5 秒内 HTTP 回包active:使用客服消息 API 主动发送asr 使用腾讯云 ASR# 构建
pnpm -F @openclaw-china/wechat-mp build
# 测试
pnpm -F @openclaw-china/wechat-mp test
# 类型检查
pnpm -F @openclaw-china/wechat-mp typecheck
doc/guides/wechat-mp/doc/开发计划.mddoc/guides/wechat-mp/configuration.mddoc/guides/wechat-mp/doc/mp接口文档/FAQs
OpenClaw WeChat Official Account (微信公众号) channel plugin
The npm package @openclaw-china/wechat-mp receives a total of 117 weekly downloads. As such, @openclaw-china/wechat-mp popularity was classified as not popular.
We found that @openclaw-china/wechat-mp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.