AI GrowthAI content creation toolkit

WeChat Official Account automated publishing tutorial

No Prior Experience Required · Windows Users · WorkBuddy + Python
All commands can be copied and pasted directly into the WorkBuddy dialog box
📋 Instructions
  1. Content in the gray box = Copy and paste directly into the WorkBuddy dialog boxinstructions for
  2. Start from step one in order, and proceed to the next step only after completing each one
  3. Steps one through three only need to be done once (environment setup); after that, each publishing session only requires step four
  4. If you run into problems, see the FAQ at the bottom
🗺️ Overall Process Overview
Apply for Official Account API → Configure Python Environment → Write the Publishing Script → Auto-Generate Articles Daily → Auto-Push to Draft Box

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:

⚠️ AppSecret is only shown once!Once you get it, save it immediately somewhere safe (like your phone's notes app). After closing the popup you can no longer view it and can only reset 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:

📦 Dialog box commands Copy and paste
Help me look up the public IP address of my current computer.
💡 WorkBuddy will tell you your IP; enter it into the WeChat Official Account platform's IP whitelist
ℹ️ If your network IP changes (e.g., home broadband), you need to check whether the IP has changed before your next post, and update the whitelist if it has.
✅ Once you have the AppID and AppSecret, move on to the next step!

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:

📦 Dialog box commands Copy, paste, then modify
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
💡 Replace "fill in xxx here" with your real information, then send it to WorkBuddy
Directory notes:Replace "your username" in the path with your Windows username. If you're not sure, open File Explorer and see which folder exists under C:\Users\ — that's your username.

2.1 Verify the environment is ready

📦 Dialog box commands Copy and paste
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
💡 If you see "access_token obtained successfully", the configuration is correct
✅ Environment configuration complete! Next, let's look at how to write articles.

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

📦 Dialog box commands Copy, paste, then modify
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
💡 Change "write the topic here" to the content direction you want

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:

📦 Dialog box commands Copy, paste, then modify
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
💡 Replace the content in the brackets with your real article

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:

📦 Dialog box commands Copy and paste
Run the WeChat Official Account publishing script and publish the article to the drafts.
💡 WorkBuddy will automatically generate the article, download images, and upload them to the WeChat Official Account drafts box

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...
ℹ️ The article is sent to thedrafts box, it will not be automatically pushed to readers. You need to manually click "Publish" in the WeChat Official Account backend to push it. This way you can review it once more before publishing.

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.

📦 Dialog box commands Copy, paste, then modify
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
💡 WorkBuddy will create an automation task that runs automatically on schedule
About automation tasks:WorkBuddy's automation feature requires the computer to be running and WorkBuddy to be open. If the computer is shut down that day, the task will run the next time it is turned on.

View and manage scheduled tasks

📦 Dialog box commands Copy and paste
Help me check which automation tasks are currently running.
📦 Dialog box commands Copy, paste, then modify
Pause the "Daily Official Account article publishing" automation task.
💡 Change the task name to your actual task name

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:

1
Go to mp.weixin.qq.com → Settings and Development → Basic Configuration, click "Reset" to get a new AppSecret
2
Copy the following and send it to WorkBuddy, filling in the new AppSecret:
📦 Dialog box commands Copy, paste, then modify
Update the WeChat Official Account AppSecret:
AppID: enter the AppID here (unchanged)
AppSecret: enter the new AppSecret here
💡 WorkBuddy will automatically update the configuration file
3
Verify after updating:
📦 Dialog box commands Copy and paste
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 doCopy this text
Publish an article to the drafts folderRun the WeChat Official Account publishing script and publish the article to the drafts.
Write an article on a new topic and publish itHelp me write an article about "xxx" and publish it to the Official Account drafts.
Check whether an article has been published todayCheck whether the WeChat Official Account has already published an article today.
Update AppSecretUpdate AppSecret: the new key is xxx
Test whether the API is working properlyTest whether the WeChat Official Account API connection works properly.
View scheduled tasksCheck which automation tasks are currently running.
Pause scheduled publishingPause the daily Official Account auto-publishing task.
Resume scheduled publishingResume the daily Official Account auto-publishing task.
Modify article style/topicModify the publishing script so that future article topics are changed to "xxx".
View publishing historyView the WeChat Official Account publishing history.
✅ For all the commands above, replace 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

📦 Dialog box commands Copy, paste, then modify
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

📦 Dialog box commands Copy, paste, then modify
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

📦 Dialog box commands Copy, paste, then modify
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
💡 Change the path to your actual image path

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:

📦 Dialog box commands Copy, paste, then modify
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:

📦 Dialog box commands Copy and paste
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:

📦 Dialog box commands Copy and paste
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:

📦 Dialog box commands Copy and paste
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?

📦 Dialog box commands Copy and paste
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:

📦 Dialog box commands Copy and paste
Run the WeChat Official Account publishing script and publish the article to the drafts.

❓ How do I change the default theme for each article?

📦 Dialog box commands Copy, paste, then modify
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".

The core is just one sentence:Once the environment is configured, just tell WorkBuddy your requirements in plain language. It will write the article, find images, and send it to the drafts for you—no manual steps required. If you get stuck, come back and check this tutorial!
Configuration parameters quick reference
Configuration itemDescriptionWhere to find it
AppIDThe Official Account's unique identifiermp.weixin.qq.com → Settings → Basic Configuration
AppSecretAPI key (keep it secret!)Same as above, click "Reset" to obtain
IP whitelistIPs allowed to call the APISame as above, enter your public IP
Config file pathKey storage location.workbuddy\wechat_config.env
Publishing script pathPython script location.workbuddy\generate_article.py
Scan the QR code to follow
Scan the QR code to follow