- Content in the gray box = Copy and paste directly into the WorkBuddy dialog boxinstructions for
- Start from step one in order, and proceed to the next step only after completing each one
- Steps one through three only need to be done once (environment setup); after that, each publishing session only requires step four
- If you run into problems, see the FAQ at the bottom
Configure once, then everything is automated. Each time you want to publish, just say one sentence in WorkBuddy.
Step 1: Get WeChat Official Account API Keys
This is the most important step. You need to get two things from the WeChat Official Platform:AppID and AppSecret, which are equivalent to the Official Account's "username + password".
1.1 Log in to the Official Platform
Open your browser and visit:
https://mp.weixin.qq.com
Scan the QR code with the WeChat you bound to log in.
1.2 Go to Developer Settings
After logging in, follow this path to find the API keys:
- Left menu → Settings & Development → Basic Configuration
- Find "Developer ID (AppID)", clickCopyon the right, and save it
- Find "Developer Password (AppSecret)", clickReset(or view), scan the QR code with WeChat to confirm, then you can see the secret key; copy and save it
1.3 Set up the IP whitelist (important)
On the same "Basic Configuration" page, find IP whitelist, you need to add your computer's IP, otherwise the API will return an error.
Don't know your IP? Copy the following and send it to WorkBuddy:
Help me look up the public IP address of my current computer.
Step 2: Configure the Python publishing environment
Let WorkBuddy set up the entire environment for you with one-click. Copy the following and replace the AppID and AppSecret with your own:
Help me set up the WeChat Official Account auto-publishing environment: AppID: enter your AppID here AppSecret: enter your AppSecret here Official Account name: enter the Official Account name here (for example: AI Growth) Author name: enter the author name here (for example: Pineapple Captain) Please help me: 1. Create the configuration file wechat_config.env in the C:\Users\your-username\WorkBuddy\Claw\.workbuddy\ directory 2. Create a Python virtual environment and install the required dependencies (requests, python-dotenv, Pillow) 3. Create the article generation script generate_article.py 4. Test whether the API connection works properly
2.1 Verify the environment is ready
Help me check whether the WeChat Official Account publishing environment is configured correctly: 1. Check whether the config file exists 2. Test obtaining an access_token with the AppID and AppSecret 3. Tell me the result
Step 3: Customize article content
Tell WorkBuddy what style and topic you want each article to have, and it will modify the script for you.
Option 1: Let WorkBuddy write it and put it in the script
Help me update the publishing script generate_article.py and put a new article into it: Topic: Write the topic here (e.g., AI tools for productivity, workplace tips, tech news) Style: Conversational, not too formal, like chatting with a friend Word count: No less than 1500 words Images: One per section, downloaded from the free Unsplash image library Ending: Add a "Daily AI Office Tip" Title format: [AI Daily] + an engaging subtitle
Option 2: You write the body, let WorkBuddy format and publish it
If you've written the content yourself, just give it to WorkBuddy to format:
Help me publish the following article to the WeChat Official Account drafts: Title: enter the title here Author: enter the author name here Body: (paste your article content here) Requirements: - Clean layout, highlight important information with colored background boxes - Add a relevant image to each section (downloaded from Unsplash) - Tell me the draft ID after publishing
Step 4: Publish the article to the drafts box (most commonly used!)
Once the environment is configured, each time you publish you only need to say this one sentence:
Run the WeChat Official Account publishing script and publish the article to the drafts.
After publishing is complete, WorkBuddy will tell you the draft ID, like this:
# Example output of a successful publish
✓ Article title: [AI Daily] The Agent Era Has Arrived
✓ Images: 8 uploaded successfully
✓ Draft added successfully!
media_id: rw_j-U8Z6aVEVxVEWyh9m...
Where can I see it after publishing?
Open mp.weixin.qq.com → Left menu → Content and Interaction → drafts box, find the article you just published, preview to confirm, then click Publish.
Step 5: Set up scheduled automatic publishing
Don't want to trigger it manually every time? Let WorkBuddy set up a scheduled task for you to automatically generate and send to the drafts folder every day.
Help me create a scheduled task that automatically publishes articles every day: Publishing time: Every day at 10 AM Content topic: Daily latest tech/AI news, different content each time with no repeats Article style: Conversational, with images, ending with a daily AI tip Publish to: AI Growth Official Account drafts Author: Pineapple Captain
View and manage scheduled tasks
Help me check which automation tasks are currently running.
Pause the "Daily Official Account article publishing" automation task.
Step 6: Update AppSecret (when the key expires)
The WeChat Official Account AppSecret sometimes needs to be reset (for example, if you forget it or change it periodically for security). How to update:
Update the WeChat Official Account AppSecret: AppID: enter the AppID here (unchanged) AppSecret: enter the new AppSecret here
Test the WeChat Official Account API connection and confirm whether the new AppSecret is valid.
Common Commands Quick Reference
All the following commandscopy and paste directlyGo to the WorkBuddy chat box to use it:
| What you want to do | Copy this text |
|---|---|
| Publish an article to the drafts folder | Run the WeChat Official Account publishing script and publish the article to the drafts. |
| Write an article on a new topic and publish it | Help me write an article about "xxx" and publish it to the Official Account drafts. |
| Check whether an article has been published today | Check whether the WeChat Official Account has already published an article today. |
| Update AppSecret | Update AppSecret: the new key is xxx |
| Test whether the API is working properly | Test whether the WeChat Official Account API connection works properly. |
| View scheduled tasks | Check which automation tasks are currently running. |
| Pause scheduled publishing | Pause the daily Official Account auto-publishing task. |
| Resume scheduled publishing | Resume the daily Official Account auto-publishing task. |
| Modify article style/topic | Modify the publishing script so that future article topics are changed to "xxx". |
| View publishing history | View the WeChat Official Account publishing history. |
xxx Replace with your actual content and copy-paste it directly into the WorkBuddy chat box!
Advanced usage: more ways to use it
📅 Schedule posts for a specific date
Help me write an article about "fill in the topic here" and automatically publish it to the Official Account drafts folder at 9 AM tomorrow.
📝 Specify a particular post format
Write a WeChat public account article for me and publish it to the drafts folder: Topic: Fill in the topic here Requirements: - Add the prefix 【AI Daily】 to the title - No fewer than 2,000 words - 8 sections, with one accompanying image per section - Highlight important content with colored background boxes - Add a daily AI office tip at the end - Style: like chatting with a friend, not too formal
🖼️ Use your own images
Help me publish a WeChat Official Account article to the drafts folder, using these images as illustrations: C:\Users\your username\Desktop\cover.jpg C:\Users\your username\Desktop\content1.jpg Article topic: fill in the topic here
FAQ
❓ What if I get the error "invalid appsecret"?
This means the AppSecret is incorrect or has expired. Go to the WeChat Official Account Platform to reset the AppSecret, then update the configuration:
Update AppSecret: fill in the new AppSecret here
❓ What if I get the error "ip unauthorized"?
You need to add your current computer's IP to the whitelist on the WeChat Official Account Platform. First, check your IP:
Help me look up the public IP address of my current computer.
Once you have the IP, go to mp.weixin.qq.com → Settings and Development → Basic Configuration → IP Whitelist, enter the IP and save.
❓ The article was published successfully, but I can't find it in the drafts?
Wait a few seconds and refresh, or use the following command to check:
Help me check the latest few articles in the WeChat Official Account drafts folder.
❓ What if the image upload fails?
WeChat Official Account has image requirements: each image must not exceed 10MB, and the format must be JPG/PNG/GIF. If downloading an online image fails, you can ask WorkBuddy to use a backup image:
The images for the last publish failed to download; help me switch to a batch of backup illustrations and run it again.
❓ The scheduled task didn't run automatically?
- Check whether WorkBuddy is still running
- Check whether the computer is powered on and connected to the internet
- Copy the following command to check the task status:
Check the status of the daily WeChat Official Account publishing scheduled task, and see the last execution time and next execution time.
❓ What if I don't want to post every day and only want to trigger it manually?
Just don't create a scheduled task. Each time you want to post, simply say:
Run the WeChat Official Account publishing script and publish the article to the drafts.
❓ How do I change the default theme for each article?
Modify the publishing script: change the default article topic to "fill in the new topic here" and the style to "fill in the style here".
| Configuration item | Description | Where to find it |
|---|---|---|
| AppID | The Official Account's unique identifier | mp.weixin.qq.com → Settings → Basic Configuration |
| AppSecret | API key (keep it secret!) | Same as above, click "Reset" to obtain |
| IP whitelist | IPs allowed to call the API | Same as above, enter your public IP |
| Config file path | Key storage location | .workbuddy\wechat_config.env |
| Publishing script path | Python script location | .workbuddy\generate_article.py |