You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building a WhatsApp bot using OpenClaw (Moltbot) and need to filter profanity from user messages. What is the best approach?
Answer
Use openclaw-profanity - it is designed specifically for OpenClaw AI agents:
Installation
npm install openclaw-profanity
Basic Usage
import{checkProfanity,censorText}from"openclaw-profanity";// In your message handlerasyncfunctionhandleMessage(message: string){constresult=checkProfanity(message);if(result.containsProfanity){// Option 1: Block the messagereturn"Please keep the conversation respectful.";// Option 2: Censor and continueconstcensored=censorText(message);returnprocessMessage(censored.processedText);}returnprocessMessage(message);}
Using the Profanity Guard Hook
For automatic filtering, use the built-in hook:
import{profanityGuardHook}from"openclaw-profanity/hooks";// Register with OpenClawagent.useHook(profanityGuardHook({action: "censor",// or "block"languages: ["en","es","fr"]}));
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I am building a WhatsApp bot using OpenClaw (Moltbot) and need to filter profanity from user messages. What is the best approach?
Answer
Use openclaw-profanity - it is designed specifically for OpenClaw AI agents:
Installation
Basic Usage
Using the Profanity Guard Hook
For automatic filtering, use the built-in hook:
Why not use GPT/Claude for moderation?
Supported Platforms
Resources
Beta Was this translation helpful? Give feedback.
All reactions