Banned Words - CosmicCubicle/PariahBot GitHub Wiki
Banned Words
/bannedwords blocks messages that contain banned words. Admins pick from
ready-made lists, add the server's own custom words, or both. Each
blocked message is reported through the server's admin alerts.
How it works
PariahBot doesn't read your members' messages. That would need Discord's privileged Message Content intent. Instead, it sets up Discord AutoMod rules for your server from the lists and words you choose, and Discord does the blocking:
- The message is blocked before anyone sees it. The sender sees "Your message was blocked because it contains a word this server has banned."
- It works even while the bot is offline.
- Each block is reported through your admin alerts (see Server Configuration ยง Alerts): who, which channel, the matched word (spoilered), and which list it came from. Discord doesn't send the bot the rest of the message.
- Members with Administrator or Manage Server are never blocked. That's Discord's rule.
The bot uses at most two of your server's AutoMod rules, both named PariahBot: banned words:
| Rule | Contains | Discord's limit |
|---|---|---|
| Keyword preset | The Discord lists you picked | 1 per server |
| Keyword | The shipped lists you picked, plus your custom words | 6 per server, 1,000 words each |
Permission: Manage Server
| What | Why |
|---|---|
| Manage Server permission | Discord only lets bots with it create or change AutoMod rules |
| Auto Moderation Execution intent | How the bot hears about each block to report it. Not privileged, and set in code, so there's nothing to switch on |
| An admin, or a mod (for you) | Turning it on or off and choosing lists is admin-only. Mods can add and remove custom words, and see the status |
Manage Server is in both permission sets on Permissions. If your bot was
invited before this feature, add Manage Server to its PariahBot role
in Server Settings โ Roles. /bannedwords checks for it and tells you if
it's missing.
Set it up
Steps 2 and 3 need an admin (Administrator or an admin role). Mods can add and remove custom words.
1. Make sure blocks have somewhere to be reported. They go wherever your admin alerts go:
/alerts status
If nothing is set, /alerts channel channel:#mod-log sends them there.
2. Pick lists, and/or add your own words:
/bannedwords list add list:Profanity
/bannedwords list add list:Scams
/bannedwords word add words:badword, another phrase, *scamsite*
3. Turn it on:
/bannedwords enable
4. Check it:
/bannedwords status
You can change lists and words at any time. While it's on, each change updates the AutoMod rules straight away.
The lists
| List | What it covers | Maintained by |
|---|---|---|
| Profanity | Swearing | Discord |
| Sexual content | Sexual terms | Discord |
| Slurs | Racist, homophobic and other slurs | Discord |
| Scams | Free Nitro, gift and crypto scams, look-alike Discord/Steam links | PariahBot |
| Harassment | Telling people to harm themselves, direct threats | PariahBot |
| Drugs | Hard drugs, buying and selling drugs | PariahBot |
How the lists combine:
- Discord's lists go into one AutoMod rule, which Discord matches with its own lists.
- PariahBot's lists and your custom words are merged into the other rule. A word in more than one list is only counted once.
- Changes apply straight away. Adding or removing a list, or a word, updates the rules immediately while the feature is on.
- Reports name the list. Each block report says which list the matched word came from. For Discord's lists, it names the lists you have on, since Discord doesn't say which one matched.
Discord doesn't publish the contents of its three lists, and keeps them up to date itself. PariahBot's own lists are short on purpose: every entry blocks real messages in every server that picks the list. They contain:
- Scams:
free nitro,free discord nitro,nitro for free,nitro giveaway,claim your nitro,free steam gift,steam gift giveaway,free robux,robux generator,free vbucks,free v-bucks,crypto giveaway,double your crypto,claim your airdrop,guaranteed profit,accidentally reported your account,i accidentally reported you,*dlscord*,*discrod*,*disc0rd*,*dicsord*,*steamcommunlty*,*stearncommunity*,*steamcomrnunity* - Harassment:
kys,kill yourself,kill urself,killyourself,go kill yourself,neck yourself,unalive yourself,end yourself,drink bleach,hope you die,i will kill you,im going to kill you,i'm going to kill you,i know where you live - Drugs:
cocaine,heroin,meth,methamphetamine,fentanyl,mdma,ketamine,crack cocaine,oxycodone,percocet,xanax,buy weed,selling weed,weed for sale,buy drugs,selling drugs,drugs for sale
Something missing? Add it as a custom word. To suggest it for everyone, open an issue.
Custom words
/bannedwords word add words:first, second phrase, *wildcard*
/bannedwords word remove word:<pick from the suggestions>
- Separate several with commas. Phrases with spaces are fine.
- Matching is whole-word and ignores case.
catblocks "Cat!" but not "category". *is a wildcard at the start or end.cat*also blocks "category";*cat*blocks it anywhere inside a word, which is how to catch a domain inside a link.- Each word can be up to 60 characters. A server can have up to 945 custom words. Discord allows 1,000 per rule, and the rest are kept for the shipped lists.
Exempting channels or roles
Discord already exempts Administrator and Manage Server. To exempt more:
- Open Server Settings โ AutoMod.
- Edit the PariahBot: banned words rules.
- Add exempt roles or channels.
The bot keeps your changes when it updates the rules. It only ever changes the word lists and whether the rule is on. The same goes for an allow list, or extra actions you add there, like posting an alert to a channel or timing the member out.
Turning it off
/bannedwords disable
The rules are switched off, not deleted, so your exemptions survive. Your
lists and words are kept, and /bannedwords enable brings it all back.
If you delete a PariahBot rule in Server Settings while the feature is on,
the bot recreates it the next time it starts, or the next time you change
anything with /bannedwords.
Limits
- Only new messages are checked. AutoMod doesn't scan messages sent before the rules existed.
- The report shows the matched word, not the whole message. The full text would need the privileged Message Content intent.
- Usernames and nicknames aren't checked. Only messages are.
- If your server already has six keyword rules, Discord won't let the bot add its own.
/bannedwords enablesays so. Delete one you don't need in Server Settings โ AutoMod.
If something doesn't work, see Troubleshooting.