Skip to content

Keywords & regex

Catch messages containing specific words, phrases, or matching custom regex patterns.

When you'd use it

  • Slur and harassment word lists
  • Brand-specific bans ("don't mention our competitor")
  • Scam phrase patterns ("FREE NITRO HERE", airdrop scams)
  • Catch-all regex for things like crypto wallet addresses, suspicious link templates

Settings

SettingWhat it does
KeywordsPlain strings to match. Up to 1000 per rule, 60 chars each.
Regex patternsPCRE-compatible patterns (matched with the u flag). 260 chars max per pattern.
Match whole wordWhen on, "bot" matches "you're a bot" but not "robot". When off, substring match.
Case sensitiveWhen off (default), "Scam" and "scam" both match.
Allow listPhrases that cancel a match. E.g. you ban "discord-airdrop" but allow "discord-airdrop-safety-tips".

Tips

  • Use whole-word matching for short words to avoid false positives. Without it, "ass" would match "assistant".
  • Test regex first — the Test pane in the dashboard runs the rule against a sample. Catch catastrophic backtracking before it lands.
  • Allow-list common false positives as you find them. A keyword rule with no allow-list catches a lot of legitimate speech.
  • One rule, one purpose. Don't mash slurs + scam phrases + competitor mentions into one rule — split them so the action chains can differ (slurs → ban; scams → timeout; competitor → delete + warn).

Common patterns

Use caseSetup
Block specific slursKeywords list + whole-word ON + case-sensitive OFF
Crypto scam phrasesKeywords: ["airdrop", "free nitro", "free discord", "claim now"] + actions: delete + 30-min timeout
Custom slangRegex: `\b(rude
Wallet address patternRegex: 0x[a-fA-F0-9]{40} (Ethereum) — catches paste-spam

Actions

Usually delete + warn is the right combination. For high-severity lists (slurs, raid keywords) chain a timeout or kick after.

Limits

  • 1000 keywords per rule
  • 60 chars per keyword
  • 260 chars per regex pattern
  • 6 actions per rule

Behaviour

  • Allow-list match short-circuits: if a message contains any allow-list phrase, the rule does not fire even if it also contains a keyword.
  • Keyword + regex matches both add hits to the rule's history. The Test pane shows which matched.
  • Rules are evaluated on every message that falls within the rule's channel scope.

Phantom is a product of Hydra Labs. The bot is run as a managed service; you do not need to host it yourself.