Communities and forums

Moderate spam, self-promotion, and off-topic posts with rules that understand context.

“Check out my tool” is welcome in #showcase and spam in #help. Keyword filters can’t tell the difference. Check posts against your community rules, with the channel and the conversation as context.

Why keyword filters miss and over-block

Spam filters based on keywords and link counts catch the obvious cases and anger regular members along the way. The same link is an answer in one channel and promotion in another. And the spam that gets through is the kind with no obvious keyword: an ad written as a question, a “has anyone tried…” that only exists to drop a referral code.

Enforly evaluates the post with that context: the channel’s purpose and the question it replies to. Your rules stay in plain language, the way you’d explain them to a new moderator.

Where the check fits

One call between the step that prepares something and the step that sends, publishes, or runs it. Your code applies the decision.

See it decide

The same policy evaluated on three cases. Pick one and run the check to see which evidence it relies on.

Policy

Posts must be on topic for data.channel.description. Self-promotion belongs in #showcase. Anywhere else, a post that exists mainly to promote something is spam, including promotion disguised as a question, a complaint, or a recommendation. If a genuine answer links the author’s own project, a moderator decides.

data

{
"channel": {
"name": "#help",
"description": "Questions about using the API"
},
"question": "Why do I get 401 with a valid key?",
"post": "You need to pass the key as a Bearer token. The auth section of the docs has an example: https://docs.example.com/auth"
}

Result

violationProbability—
reviewProbability—

Why: It answers the question, and the link points to documentation, not something the author is promoting.

Your code: Keep the post visible.

Response JSON
{
  "decision": "allow",
  "allowed": true,
  "violationProbability": 0.03,
  "reviewProbability": 0.06,
  "policyId": null,
  "policyVersion": null,
  "requestId": "req_7f3a…"
}

Illustrative example. Real probabilities depend on your policy wording and the evidence you send.

allow · Helpful answer

It answers the question, and the link points to documentation, not something the author is promoting.

deny · Disguised promotion

It’s phrased as a question, but it asks nothing about the API and ends with a referral code. The post exists to promote a service outside #showcase.

review · Own product as answer

It’s a relevant answer, but it links the author’s own project, and the policy leaves that to a moderator.

Fits the tools you already use

Most community platforms can call a webhook or run a bot when a post is created. Call Enforly from there, then keep, hide, or flag the post. Your bot decides what to do; Enforly only evaluates.

  • Discord / Slack: a bot listening to new messages.
  • Discourse / Circle: a webhook on post creation.
  • Your own app: before the post is saved as public.

Set it up

  1. 1

    Write your community rules

    Per channel, if needed. Say what counts as promotion and where it’s welcome.

  2. 2

    Check new and edited posts

    Send the post, the channel description, and the message it replies to.

  3. 3

    Keep, hold, or hide

    Use review to fill your moderator queue with the posts that actually need judgment.

Discord bot (discord.js)
import { Enforly } from '@enforly/sdk'

const guard = new Enforly({ apiKey: process.env.ENFORLY_API_KEY })

client.on('messageCreate', async (message) => {
  if (message.author.bot) return
  const result = await guard.check({
    policyId: COMMUNITY_RULES_ID,
    data: {
      channel: { name: message.channel.name, description: message.channel.topic },
      question: message.reference ? (await message.fetchReference()).content : null,
      post: message.content,
    },
  })
  if (result.decision === 'deny') await message.delete()
  if (result.decision === 'review') await modQueue.send(`Review: ${message.url}`)
})

Full request and response fields are in the API reference. Using a coding agent? Point it to Build with AI.

What Enforly doesn’t do

Enforly evaluates the information you send and returns a decision. It doesn’t run operations, and it doesn’t guarantee safety or compliance on its own.

  • Enforly evaluates each post you send; it doesn’t read your channels. Send the thread context yourself.
  • It doesn’t remove posts or ban users. Your bot does.
  • For high-volume channels, mind your plan’s monthly checks and requests per minute.

Questions

Can it moderate in languages other than English?

Policies and posts don’t have to be in English. Test your policy with real posts in each language your community uses before relying on it.

Should I hide posts while they’re being checked?

For most communities, post first and hide on deny. For high-risk spaces, hold posts until the check returns.

Related

Try this policy on your own data.

Copy the policy above, add your real examples, and see the decision. 200 free checks per month, no credit card.