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
帮我查一下我当前电脑的公网IP地址。
💡 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
帮我配置微信公众号自动发文环境:

AppID:在这里填你的AppID
AppSecret:在这里填你的AppSecret
公众号名称:在这里填公众号名称(比如:AI Growth)
作者名:在这里填作者名(比如:菠萝大队长)

请帮我:
1. 在 C:\Users\你的用户名\WorkBuddy\Claw\.workbuddy\ 目录下创建配置文件 wechat_config.env
2. 创建 Python 虚拟环境并安装所需依赖(requests、python-dotenv、Pillow)
3. 创建文章生成脚本 generate_article.py
4. 测试 API 连接是否正常
💡 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
帮我检查微信公众号发文环境是否配置正常:
1. 检查配置文件是否存在
2. 测试用 AppID 和 AppSecret 获取 access_token
3. 告诉我结果
💡 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
帮我更新发文脚本 generate_article.py,写一篇新文章放进去:

主题:在这里写主题(比如:AI工具提效、职场干货、科技资讯)
风格:口语化,不要太正式,像朋友聊天那种
字数:不少于1500字
配图:每个章节一张,从 Unsplash 免费图库下载
结尾:加上一个"每日AI办公小技巧"

标题格式:【AI日报】+ 吸引人的副标题
💡 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
帮我把下面的文章发布到微信公众号草稿箱:

标题:在这里填标题
作者:在这里填作者名
正文:
(在这里粘贴你的文章内容)

要求:
- 排版简洁,重要信息用彩色背景框标出
- 每个章节加一张相关配图(从 Unsplash 下载)
- 发布完告诉我草稿ID
💡 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
运行微信公众号发文脚本,把文章发布到草稿箱。
💡 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:

# 发布成功示例输出
✓ 文章标题: 【AI日报】智能体时代来了
✓ 配图: 8 张上传成功
✓ 草稿添加成功!
  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
帮我创建一个每天自动发文的定时任务:

发文时间:每天上午10点
内容主题:每日最新科技/AI资讯,每次写不同的内容不重复
文章风格:口语化,附配图,结尾有每日AI小技巧
发布到:AI Growth公众号草稿箱
作者:菠萝大队长
💡 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
帮我查看当前有哪些自动化任务在运行。
📦 Dialog box commands Copy, paste, then modify
暂停"每日公众号文章发布"这个自动化任务。
💡 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
更新微信公众号 AppSecret:
AppID:在这里填AppID(不变)
AppSecret:在这里填新的AppSecret
💡 WorkBuddy will automatically update the configuration file
3
Verify after updating:
📦 Dialog box commands Copy and paste
测试微信公众号 API 连接,确认新的 AppSecret 是否有效。

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 folder运行微信公众号发文脚本,把文章发布到草稿箱。
Write an article on a new topic and publish it帮我写一篇关于"xxx"的文章,发布到公众号草稿箱。
Check whether an article has been published today查看微信公众号今天是否已经发过文章。
Update AppSecret更新AppSecret:新的密钥是 xxx
Test whether the API is working properly测试微信公众号 API 连接是否正常。
View scheduled tasks查看当前有哪些自动化任务在运行。
Pause scheduled publishing暂停每日公众号自动发文任务。
Resume scheduled publishing恢复每日公众号自动发文任务。
Modify article style/topic修改发文脚本,以后文章主题改为"xxx"。
View 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
帮我写一篇关于"在这里填主题"的文章,明天上午9点自动发布到公众号草稿箱。

📝 Specify a particular post format

📦 Dialog box commands Copy, paste, then modify
帮我写一篇公众号文章并发布到草稿箱:

主题:在这里填主题
要求:
- 标题加【AI日报】前缀
- 不少于2000字
- 8个章节,每章节一张配图
- 重要内容用彩色背景框标出
- 结尾加每日AI办公小技巧
- 风格:像朋友聊天,不要太正式

🖼️ Use your own images

📦 Dialog box commands Copy, paste, then modify
帮我发布一篇公众号文章到草稿箱,使用这些图片作为配图:
C:\Users\你的用户名\Desktop\封面图.jpg
C:\Users\你的用户名\Desktop\内容图1.jpg
文章主题:在这里填主题
💡 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
更新AppSecret:在这里填新的AppSecret

❓ 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
帮我查一下我当前电脑的公网IP地址。

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
帮我查询微信公众号草稿箱最新的几篇文章。

❓ 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 scheduled task didn't run automatically?

📦 Dialog box commands Copy and paste
检查每日公众号发文定时任务的状态,看看上次执行时间和下次执行时间。

❓ 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
运行微信公众号发文脚本,把文章发布到草稿箱。

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

📦 Dialog box commands Copy, paste, then modify
修改发文脚本,把默认文章主题改为"在这里填新主题",风格改为"在这里填风格"。

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