Skip to content
All projects

Case study 04Automation · Security · Discord

HALLGuard

Moderation and management for Discord communities.

A Discord moderation and server-management system focused on security: automated protection against spam and raids, configurable rules, and an audit trail for every action.

Visit sitehallguard.org(opens in a new tab)
Role
Design and engineering — bot, rule engine, dashboard
Platform
Discord + web panel
Stack
Discord API, Gateway events, Python, REST APIs, Web dashboard
hallguard.org / dashboard

01Overview

HALLGuard keeps Discord servers safe without requiring moderators to be online around the clock. It listens to server events, evaluates them against per-server rules, acts proportionally, and records everything so humans stay in control.

02Problem

Community moderation breaks at the edges: raids at 3 a.m., spam waves faster than people can click, and permission setups so complex that admins accidentally lock themselves out.

03Goals

  1. G1React to abuse in seconds, at any hour
  2. G2Avoid false positives that punish real members
  3. G3Make powerful configuration approachable
  4. G4Keep every automated decision explainable

04My role

Design and engineering — bot, rule engine, dashboard.

  • Bot architecture and Discord gateway event handling
  • Rule engine design and detection heuristics
  • Permission model and safety checks
  • Dashboard and website

05Technology

Bot
Discord API / Gateway events / Python
Platform
REST APIs / Persistent configuration store
Web
Dashboard / hallguard.org

06Architecture

Events flow one way — observe, evaluate, act, record — which keeps the system predictable and auditable.

  1. 01

    Gateway events

    Messages, joins, role and channel changes stream in from Discord

  2. 02

    Router

    Normalises events and attaches per-server configuration

  3. 03

    Rule engine

    Sliding-window detectors for spam, raids, links and mentions

  4. 04

    Actions

    Proportional responses checked against role hierarchy before executing

  5. 05

    Audit log

    Every decision recorded with the reason, visible to moderators

07Challenges & solutions

C1Raids arrive as bursts

Dozens of accounts can join and post within seconds; per-message rules miss the pattern.

Dozens of accounts can join and post within seconds; per-message rules miss the pattern.

Sliding-window detectors that reason about rates across the server, with a lockdown mode that engages and releases automatically.

Sliding-window detectors that reason about rates across the server, with a lockdown mode that engages and releases automatically.

C2False positives cost trust

An over-eager bot that bans real members is worse than no bot.

An over-eager bot that bans real members is worse than no bot.

Graduated responses and per-server thresholds, so the first signal warns and only repeated or severe behaviour escalates.

Graduated responses and per-server thresholds, so the first signal warns and only repeated or severe behaviour escalates.

C3Permission edge cases

Discord's role hierarchy means an action can silently fail — or succeed against the wrong person.

Discord's role hierarchy means an action can silently fail — or succeed against the wrong person.

Pre-flight checks on every action against the bot's and target's role positions, with clear errors in the log.

Pre-flight checks on every action against the bot's and target's role positions, with clear errors in the log.

08Screens

  • hallguard.org / dashboard
    a.Server overview — protection status and recent activity
  • hallguard.org / log
    b.Audit log — every action with its reason
  • hallguard.org
    HALLGuard website home page with a Discord chat showing the bot blocking a phishing link
    c.hallguard.org — the live product site

09Results

  • Live at hallguard.org
  • Automated moderation that runs continuously without moderator presence
  • An auditable trail that keeps human moderators in control
Visit sitehallguard.org(opens in a new tab)

10Lessons learned

“Security tooling lives or dies by its false-positive rate.”

“Proportional responses beat binary rules.”

“If an automated action can't explain itself, it shouldn't run.”