weixin-channel-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese微信通道配置助手
WeChat Channel Configuration Assistant
本技能帮助用户快速配置 Qwen Code 的微信通道功能,让 AI 助手通过微信与你交互。
This skill helps users quickly configure the WeChat channel feature of Qwen Code, enabling the AI assistant to interact with you via WeChat.
快速开始(3 步完成)
Get Started (3 Steps)
第 1 步:扫码登录微信
Step 1: Scan QR Code to Log in to WeChat
运行以下命令启动微信登录流程:
bash
qwen channel configure-weixin操作流程:
- 终端会显示二维码 URL
- 打开该 URL 查看二维码
- 使用微信扫码并确认登录
- 等待提示 "Connected to WeChat successfully!"
保存的信息:
- Token 和 BaseURL 自动保存到
~/.qwen/channels/weixin/account.json - 你的微信 ID 会自动记录,后续配置需要用到
Run the following command to start the WeChat login process:
bash
qwen channel configure-weixinOperation Flow:
- The terminal will display a QR code URL
- Open the URL to view the QR code
- Scan the QR code with WeChat and confirm login
- Wait for the prompt "Connected to WeChat successfully!"
Saved Information:
- Token and BaseURL are automatically saved to
~/.qwen/channels/weixin/account.json - Your WeChat user ID will be automatically recorded for subsequent configuration
第 2 步:添加到配置文件
Step 2: Add to Configuration File
编辑 ,添加或更新 配置:
~/.qwen/settings.jsonchannelsjson
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "allowlist",
"allowedUsers": ["YOUR_WEIXIN_USER_ID"],
"sessionScope": "user",
"cwd": "/path/to/your/project",
"instructions": "你是一个简洁的编程助手,通过微信回复。保持回答简短。",
"model": "qwen3.5-plus"
}
}
}获取你的微信 ID:
bash
cat ~/.qwen/channels/weixin/account.json | grep userId将输出中的 值替换到配置文件的 数组中。
userIdallowedUsersEdit to add or update the configuration:
~/.qwen/settings.jsonchannelsjson
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "allowlist",
"allowedUsers": ["YOUR_WEIXIN_USER_ID"],
"sessionScope": "user",
"cwd": "/path/to/your/project",
"instructions": "You are a concise programming assistant, replying via WeChat. Keep answers brief.",
"model": "qwen3.5-plus"
}
}
}Get Your WeChat User ID:
bash
cat ~/.qwen/channels/weixin/account.json | grep userIdReplace the value from the output into the array in the configuration file.
userIdallowedUsers第 3 步:启动通道服务
Step 3: Start the Channel Service
bash
qwen channel start my-weixin看到 "[Channel] "my-weixin" is running. Press Ctrl+C to stop." 即表示成功!
现在打开微信,找到你的机器人助手,发送消息测试吧。
bash
qwen channel start my-weixinYou're successful when you see "[Channel] "my-weixin" is running. Press Ctrl+C to stop."!
Now open WeChat, find your bot assistant, and send a message to test it out.
配置选项说明
Configuration Option Explanations
| 选项 | 必填 | 说明 | 示例 |
|---|---|---|---|
| ✅ | 通道类型,固定为 | |
| ❌ | 访问策略: | |
| 推荐 | 允许使用的微信用户 ID 列表 | |
| ❌ | 会话范围: | |
| 推荐 | AI 工作目录 | |
| ❌ | 系统指令,控制 AI 行为风格 | "保持回答简短" |
| ❌ | 使用的模型 | |
| Option | Required | Description | Example |
|---|---|---|---|
| ✅ | Channel type, fixed as | |
| ❌ | Access policy: | |
| Recommended | List of allowed WeChat user IDs | |
| ❌ | Session scope: | |
| Recommended | AI working directory | |
| ❌ | System instructions to control the AI's behavior style | "Keep answers brief" |
| ❌ | Model to use | |
常用管理命令
Common Management Commands
bash
undefinedbash
undefined查看当前配置的通道
View currently configured channels
qwen channel --help
qwen channel --help
启动微信通道
Start WeChat channel
qwen channel start my-weixin
qwen channel start my-weixin
查看微信账号状态
Check WeChat account status
qwen channel configure-weixin status
qwen channel configure-weixin status
清除微信凭证(重新登录时使用)
Clear WeChat credentials (use when re-logging in)
qwen channel configure-weixin clear
qwen channel configure-weixin clear
停止通道(Ctrl+C 或 kill 进程)
Stop the channel (Ctrl+C or kill process)
kill <PID>
---kill <PID>
---故障排查
Troubleshooting
问题 1:扫码后无法连接
Issue 1: Failed to Connect After Scanning QR Code
可能原因:
- 网络问题导致超时
- iLink API 暂时不可用
解决方案:
bash
undefinedPossible Causes:
- Timeout due to network issues
- iLink API is temporarily unavailable
Solutions:
bash
undefined重新运行配置命令
Re-run the configuration command
qwen channel configure-weixin
undefinedqwen channel configure-weixin
undefined问题 2:发送消息无响应
Issue 2: No Response When Sending Messages
检查清单:
- 通道服务是否正在运行()
ps aux | grep "channel start" - 你的微信 ID 是否在 中
allowedUsers - 格式是否正确(JSON 语法)
settings.json
调试方法:
bash
undefinedChecklist:
- Is the channel service running ()
ps aux | grep "channel start" - Is your WeChat user ID in
allowedUsers - Is the format correct (JSON syntax)
settings.json
Debugging Method:
bash
undefined查看详细日志
View detailed logs
DEBUG=1 qwen channel start my-weixin
undefinedDEBUG=1 qwen channel start my-weixin
undefined问题 3:想更换微信账号
Issue 3: Want to Switch WeChat Accounts
bash
undefinedbash
undefined清除旧凭证
Clear old credentials
qwen channel configure-weixin clear
qwen channel configure-weixin clear
重新扫码登录
Re-scan QR code to log in
qwen channel configure-weixin
---qwen channel configure-weixin
---高级用法
Advanced Usage
多用户支持
Multi-User Support
在 中添加多个微信用户:
allowedUsersjson
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "allowlist",
"allowedUsers": ["user1@im.wechat", "user2@im.wechat", "user3@im.wechat"]
}
}
}Add multiple WeChat user IDs to :
allowedUsersjson
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "allowlist",
"allowedUsers": ["user1@im.wechat", "user2@im.wechat", "user3@im.wechat"]
}
}
}开放模式(任何人可用)
Open Mode (Available to Anyone)
⚠️ 警告:此模式下任何人都可以使用你的机器人,请谨慎开启!
json
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "open"
}
}
}⚠️ Warning: In this mode, anyone can use your bot, please enable it with caution!
json
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "open"
}
}
}自定义 AI 行为
Customize AI Behavior
通过 字段定义 AI 的风格:
instructionsjson
{
"instructions": "你是一个专业的代码审查助手。回答要简洁专业,优先给出解决方案,然后解释原因。"
}Define the AI's style via the field:
instructionsjson
{
"instructions": "You are a professional code review assistant. Answers should be concise and professional, prioritizing solutions followed by explanations."
}安全注意事项
Security Notes
- 保护 account.json:该文件包含你的微信认证 token,权限已设置为 (仅所有者可读写)
600 - 不要分享 token:切勿将 内容分享给他人
account.json - 定期清理:长时间不使用时,运行 清除凭证
configure-weixin clear
- Protect account.json: This file contains your WeChat authentication token, and its permissions are set to (only the owner can read and write)
600 - Do not share tokens: Never share the content of with others
account.json - Regularly clean up: When not in use for a long time, run to clear credentials
configure-weixin clear
下一步
Next Steps
- 阅读完整文档:查看
docs/users/features/channels/overview.md - 了解 Telegram 通道:查看
docs/users/features/channels/telegram.md - 探索更多功能:运行
qwen --help
- Read the full documentation: See
docs/users/features/channels/overview.md - Learn about Telegram channel: See
docs/users/features/channels/telegram.md - Explore more features: Run
qwen --help