Skip to main content

Custom Moderation Rules — Your Keywords and Patterns

Create your own moderation rules from keywords and patterns, beyond the built-in engine. Match on words, regular expressions, links and media.

8 min read
In short

Custom rules let you moderate on your own keywords and patterns, on top of what the built-in protection already catches. A rule matches message text (plain words or regex) plus optional conditions — has links, has media, new member, length — combined with AND, and applies an action with a score. Each group gets a number of rules based on its plan: 5 on Free, 20 on Basic, 100 on Pro, unlimited on Business, with a hard ceiling of 100 rules per single group. Admins and whitelisted members are always exempt.

Custom Rules — moderate on your own keywords and patterns.

Want to set this up? Do it right in your Telm account.

Open in your dashboard

1What custom rules are for

The anti-spam engine handles the universal stuff — scams, phishing, known spammers, mass campaigns. Custom rules are for what is specific to you: a competitor's brand you never want advertised, jargon that signals an off-topic post, a phrase that always means trouble in your niche.

You describe the text to match and the action to take, and the bot enforces it on every message from a regular member — no code, all from the dashboard. Rules are stored per group, so each community can have its own policy.

2How a rule is evaluated

A rule is a set of conditions plus an action. Every condition you add must be true for the rule to fire — they are combined with AND. Rules are checked in priority order (highest first), and the first rule whose action is punitive decides what happens to the message.

When a rule matches it adds to the message's spam score (30 points by default) and can carry an explanation that shows up in the journal. A special whitelist-type rule works in reverse: it clears the contribution of your custom-rule layer for that message and stops further custom-rule checks, which is how you carve out a deliberate exception.

3Conditions and actions you can use

A rule can combine any of these conditions (all must match):

  • Words — plain keywords or phrases; matching is case-insensitive and substring-based.
  • Patterns — one or more regular expressions for precise or fuzzy matching.
  • Has links — the message does or does not contain links.
  • Has media — the message does or does not contain media.
  • New member — the author is (or is not) a newcomer.
  • Minimum and maximum length — the message text falls within a length range.
  • Action — what happens when the rule fires: warn, mute, delete or ban.

4How many rules you get

The number of custom rules is tied to your plan. Higher plans unlock more room for fine-grained policy:

  • Free — 5 custom rules.
  • Basic — 20 custom rules.
  • Pro — 100 custom rules.
  • Business — unlimited (subject to the per-group ceiling below).
Even on unlimited plans, a single group can hold at most 100 custom rules — a hard ceiling that keeps moderation fast and predictable for everyone. If you hit your plan limit, upgrade in the dashboard or consolidate rules with regular expressions. See plans and pricing.

5Working with regular expressions

Regex is the way to keep your rule count low and your matching precise. One pattern can cover many spellings, spacing tricks and variants that would otherwise each need a separate keyword. Patterns are validated when you save a rule: one that fails to compile is rejected on the spot rather than silently never matching.

There are sensible limits per rule to keep moderation fast for the whole service: up to 20 patterns, each up to 512 characters, and up to 100 words, each up to 128 characters. These are generous for real policy and exist only to stop one oversized rule from slowing the shared engine.

Use word boundaries (\bword\b) to avoid catching innocent substrings, and group alternatives with (a|b|c) to fold several keywords into one pattern and save a rule slot.

6Custom rules vs. triggers

Custom rules and triggers look similar but do different jobs. A custom rule matches text and moderates it as part of the anti-spam scoring. A trigger is a full if-this-then-that automation with a wider set of actions (including replies with buttons and admin notifications) and it runs before the anti-spam engine, so it can act on — or wave through — a message ahead of any automatic check.

Rule of thumb: reach for a custom rule when you want to add something to the spam decision, and a trigger when you want an automated response or a hard override that runs first.

7Best practices and common mistakes

A little discipline keeps rules sharp:

  • Combine related keywords into one regex rule instead of spending a slot on each — cleaner and lighter on your quota.
  • Keep patterns specific. A rule that is too broad removes legitimate messages; watch the journal right after adding one.
  • Give the most important rules higher priority so they decide the action before a broader rule can.
  • Never worry about your own team tripping a rule — admins and whitelisted members are exempt from all moderation.
  • If a rule misfires, do not delete it blindly; open the catch in the journal, mark it, and tighten the pattern.
Was this article helpful?

Ready to protect your group?

Add Telm to your Telegram group and let it handle the spam.