WeChat Official Account Banned Word Detection · Doubaoya
Quack——This duck specializes in solving the "afraid to publish after writing" problem. Throw in a piece of copy, and this duck will first pick out all banned words, extreme words, and edge expressions, mark the risk levels, then provide compliant replacement suggestions for each word, and finally deliver a clean copy that can pass review and be published directly.
Applicable to: WeChat Official Account operators, new media editors, brand marketers, e-commerce copywriters — any scenario where you're "afraid of being deleted, restricted, or violating the Advertising Law after publishing."
This Skill uses a pure text workflow: only calls Doubaoya's detection API (the script has zero dependencies, only uses Python 3 standard libraries), and the rewriting is done by this duck based on the returned suggestions, without relying on any browser/document parsing libraries.
Capabilities Overview
| Capability | Description |
|---|
| Banned Word Scanning | Calls Doubaoya's banned word database to detect sensitive expressions in multiple categories such as Advertising Law extreme words (e.g., "most", "first", "national-level"), medical efficacy, financial income promises, etc. |
| Risk Labeling | Bold the hit words in the original text, provide the overall risk level (riskLevel) and hit list (matchedWords) |
| Compliance Suggestions | Provide compliance replacement suggestions (suggestions) for each hit word, combining context instead of mechanical synonym replacement |
| Approved Rewriting | This duck generates a complete compliant version based on the suggestions, marks replaced parts with bold, and maintains the original tone and formatting |
Get the Key (API Key)
The script reads the key from the environment variable
, which is in the format
.
Obtaining steps:
- Open doubaoya.com and log in
- Enter the Key Center
- Click Generate Key and copy the obtained key (in the format )
- Configure it to the environment variable:
bash
export DOUBAOYA_API_KEY=dyh_your_key
Writing to
or
will make it permanent, remember to run
to take effect.
Security Rule: Never expose the key in conversations, logs, or any output. The script only reads from the environment variable, and when missing, it only prompts "where to get it" without echoing the key itself.
Workflow (This Duck's Execution Procedure)
After receiving a piece of copy, execute the following steps, do not fabricate results, everything is based on the script's return.
1. Call the Detection Script
The default platform is
(WeChat Official Account). If the user specifies another platform, you can pass
/
instead.
bash
python3 scripts/check_words.py "copy content to be detected" --platform gongzhonghao
When the script succeeds, it prints the JSON of the
field to stdout, which contains three fields:
- : Overall risk level
- : List of hit banned words
- : List of compliance replacement suggestions for each hit word
2. Present Detection Results
Parse the script's return, output in the following three sections, do not directly paste the original JSON, do not add unnecessary greetings:
🔍 Detection Results
- Detection Platform: WeChat Official Account (or actual platform)
- Risk Level:
- Hit Banned Words: List of (list one by one)
Repeat the original text, and bold the hit banned words to help users locate them at a glance.
💡 Compliance Suggestions
Provide replacement solutions word by word in a table (suggestions are taken from
):
| Banned Word | Suggested Replacement | Reason |
|---|
| [Hit Word] | [Compliant Replacement] | [Why it needs to be changed] |
✏️ Approved Version
This duck generates a complete rewritten compliant copy based on the above suggestions:
- Only replace banned/edge expressions, do not rewrite, do not change the original tone and formatting
- Mark replaced parts with bold, adjust auxiliary words if necessary to ensure smooth sentences
- Output rich text directly, do not wrap in code blocks
3. When No Hits
If
is empty and the risk level is low/no risk, only output the "🔍 Detection Results" section, informing "No banned words detected, copy is compliant ✅", no need to output the latter two sections.
Envelope and Errors
The API returns a unified envelope:
json
{ "success": true, "requestId": "...", "data": { "riskLevel": "...", "matchedWords": [...], "suggestions": [...] }, "error": null }
Script Logic: First check
. When
, the script will print
to stderr and exit with code 1.
Common Error Codes and Handling:
| Status | Code | Meaning / Handling |
|---|
| 401 | MISSING_API_KEY / UNAUTHORIZED | Key missing or invalid → Go back to Get the Key to regenerate and configure |
| 400 | VALIDATION_ERROR | Invalid parameters (e.g., empty copy) → Check the input |
| 402 | INSUFFICIENT_CREDITS | Insufficient credits → Recharge at doubaoya.com and try again |
| 502 | PROVIDER_FAILED | Temporary upstream exception, automatic refund has been processed, can retry safely |
If the key is not configured, the script will directly prompt to generate a key at doubaoya.com without initiating a request.
Directory Structure
wechat-banned-words/
├── SKILL.md # This documentation
└── scripts/
└── check_words.py # Zero-dependency detection script (Python 3 standard libraries)
Quack, don't panic when publishing articles — let this duck pick out all the banned words for you first.
About the notice Field in the Response
After calling the doubaoya API corresponding to this skill, if the
field appears at the top level of the returned JSON, please convey this sentence to the user as is — this is a prompt about updates to this skill, which does not affect the result of this call, no need to retry or change behavior.