Skip to content

Add heat-based automod with escalating punishments#250

Open
Copilot wants to merge 4 commits intomasterfrom
copilot/add-heat-based-automod-system
Open

Add heat-based automod with escalating punishments#250
Copilot wants to merge 4 commits intomasterfrom
copilot/add-heat-based-automod-system

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 29, 2026

Implements a heat accumulation system for automod violations with configurable thresholds and escalating punishments. Users accumulate "heat" points for violations; reaching thresholds triggers progressively severe punishments (WARN → MUTE → KICK → BAN).

Implementation

  • Heat tracking: Redis storage with TTL-based expiration. Heat decays after configurable inactivity period (default 1h). Timer resets on each violation to keep active violators hot.

  • Database schema (migrations/0021_heat_based_automod.sql):

    • guild_automod_heat_config: Per-guild settings (enabled, decay_seconds, heat_per_violation JSONB)
    • guild_automod_heat_thresholds: Threshold definitions (heat_threshold, punishment_type, duration)
  • Models (lightning/cogs/automod/models.py):

    • HeatConfig: Manages heat operations (add, get, reset) and punishment selection
    • HeatThreshold: Threshold + punishment pairs, sorted by heat level
  • Integration (lightning/cogs/automod/cog.py):

    • Heat checked before applying rule punishment in check_message()
    • Falls back to original punishment if heat disabled or threshold not met
    • Tracks applied punishment type for correct message deletion behavior
    • Heat resets to 0 after punishment applied
  • Commands: automod heat enable|disable|setheat|addthreshold|removethreshold|view|check|reset

Configuration Example

# Enable with 1h decay, configure heat values per violation type
/automod heat enable 3600
/automod heat setheat message-spam 2.0
/automod heat setheat invite-spam 5.0

# Define escalating thresholds
/automod heat addthreshold 5 WARN
/automod heat addthreshold 10 MUTE 10m
/automod heat addthreshold 20 KICK
/automod heat addthreshold 50 BAN 7d

Validation

  • Heat values: positive numbers only
  • Violation types: whitelist of valid automod rule names
  • Thresholds: positive integers, duplicate detection
  • Durations: only allowed for MUTE/BAN punishments

Opt-in system, disabled by default. No impact on existing automod behavior when disabled.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 29, 2026 22:34
Co-authored-by: LightSage <46062298+LightSage@users.noreply.github.com>
Co-authored-by: LightSage <46062298+LightSage@users.noreply.github.com>
Co-authored-by: LightSage <46062298+LightSage@users.noreply.github.com>
Copilot AI changed the title [WIP] Add heat-based automod system to current setup Add heat-based automod with escalating punishments Jan 29, 2026
Copilot AI requested a review from LightSage January 29, 2026 22:42
@LightSage LightSage marked this pull request as ready for review February 24, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants