weixin-channel-setup
Original:🇨🇳 Chinese
Translated
Help users quickly configure and use the WeChat channel feature. Use this skill when users want to 'configure WeChat', 'connect to WeChat', 'set up WeChat bot', 'weixin setup', or 'wechat channel'.
7installs
Added on
NPX Install
npx skill4agent add qwenlm/qwen-code-examples weixin-channel-setupTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →WeChat Channel Configuration Assistant
This skill helps users quickly configure the WeChat channel feature of Qwen Code, enabling the AI assistant to interact with you via WeChat.
Get Started (3 Steps)
Step 1: Scan QR Code to Log in to WeChat
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
Step 2: Add to Configuration File
Edit 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.
userIdallowedUsersStep 3: Start the Channel Service
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
| 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
# View currently configured channels
qwen channel --help
# Start WeChat channel
qwen channel start my-weixin
# Check WeChat account status
qwen channel configure-weixin status
# Clear WeChat credentials (use when re-logging in)
qwen channel configure-weixin clear
# Stop the channel (Ctrl+C or kill process)
kill <PID>Troubleshooting
Issue 1: Failed to Connect After Scanning QR Code
Possible Causes:
- Timeout due to network issues
- iLink API is temporarily unavailable
Solutions:
bash
# Re-run the configuration command
qwen channel configure-weixinIssue 2: No Response When Sending Messages
Checklist:
- 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
# View detailed logs
DEBUG=1 qwen channel start my-weixinIssue 3: Want to Switch WeChat Accounts
bash
# Clear old credentials
qwen channel configure-weixin clear
# Re-scan QR code to log in
qwen channel configure-weixinAdvanced Usage
Multi-User Support
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)
⚠️ Warning: In this mode, anyone can use your bot, please enable it with caution!
json
{
"channels": {
"my-weixin": {
"type": "weixin",
"senderPolicy": "open"
}
}
}Customize AI Behavior
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
- 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
- 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