How treymouledoux/regy-bot works
Regy-Bot is a Discord regex-moderation bot. Its main workflow is to receive Discord events, scan or re-scan messages against server rules, then remove violations, track infractions, and notify users or staff. Separate capabilities cover server configuration and staff management, RTI community regex templates, raid detection, and moderation commands. The excerpts show startup dispatch, portions of message handling, and selected utilities; several feature links below are based on README descriptions rather than inspected implementation.
Main entry points: mod.rs Slash command registry · new_message.rs Message scanning · main.rs Bot startup and dispatch · structs.rs Server configuration
Components 26
Discord runtime
- Bot startup and dispatch
src/main.rs - Slash command registry
src/commands/mod.rs
Moderation
- Message scanning
src/events/new_message.rs - Edited-message scanning
src/events/update_message.rs - Automod integration
src/events/automod_execution.rs - Infraction commands
src/commands/infractions - Moderation commands
src/commands/moderation
Server administration
- Server setup and cloning
src/commands/management - Dead-zone commands
src/commands/management - Staff management commands
src/commands/management/staff - Regex rule commands
src/commands/regex - Staff-role configuration
src/utils/config/staff/mod.rs - Legacy staff configuration
src/utils/config/staff/legacy.rs
Bot features
- RTI search and updates
src/commands/rti - RTI package index
src/utils/rti.rs - Raid detection (IPM)
src/utils/ipm.rs - Compiled regex cache
src/utils/crc.rs - Message logging
src/events/new_message.rs - Member and ban events
src/events/guild_member_join.rs - Reaction workflows
src/events/reaction_add.rs
Configuration and utilities
- Server configuration
src/utils/config/structs.rs - Regex rule storage
src/utils/config/regex.rs - Dead-zone storage
src/utils/config/dead_zones.rs - Infraction storage
src/utils/config/infractions.rs - Configuration migration
src/utils/config/updating.rs
Other components
- Discord
Connections 33
- Discord → Bot startup and dispatch: delivers events
src/main.rs - Bot startup and dispatch → Slash command registry: registers commands
src/main.rs - Bot startup and dispatch → Message scanning: dispatches messages
src/main.rs - Bot startup and dispatch → Edited-message scanning: dispatches edits
src/main.rs - Bot startup and dispatch → Automod integration: dispatches actions
src/main.rs - Slash command registry → Infraction commands: registers commands
src/commands/mod.rs - Slash command registry → Moderation commands: registers commands
src/commands/mod.rs - Slash command registry → Server setup and cloning: registers commands
src/commands/mod.rs - Slash command registry → Dead-zone commands: registers commands
src/commands/mod.rs - Slash command registry → Staff management commands: registers commands
src/commands/mod.rs - Slash command registry → Regex rule commands: registers commands
src/commands/mod.rs - Slash command registry → RTI search and updates: registers commands
src/commands/mod.rs - Message scanning → Dead-zone storage: checks channel
src/events/new_message.rs - Message scanning → Infraction storage: records violations
src/events/new_message.rs - Edited-message scanning → Dead-zone storage: checks channel
src/events/update_message.rs - Edited-message scanning → Infraction storage: records violations
src/events/update_message.rs - Message scanning → Message logging: sends moderation logs
README.md - Message scanning → Raid detection (IPM): updates raid tally
- Message scanning → Compiled regex cache: uses compiled cache
- RTI search and updates → RTI package index: searches packages
src/commands/rti/mod.rs - Regex rule commands → Regex rule storage: manages rules
- Staff management commands → Staff-role configuration: manages roles
- Staff management commands → Legacy staff configuration: manages legacy staff
- Server setup and cloning → Server configuration: configures server
- Dead-zone commands → Dead-zone storage: manages channels
src/commands/management/remove_dead_zone.rs - Infraction storage → Server configuration: uses config model
src/utils/config/infractions.rs - Regex rule storage → Server configuration: uses config model
src/utils/config/regex.rs - Configuration migration → Server configuration: converts configuration
src/utils/config/updating.rs - Bot startup and dispatch → Configuration migration: migrates legacy config
src/main.rs - Discord → Member and ban events: sends member events
README.md - Discord → Reaction workflows: sends reactions
- Message scanning → Moderation commands: removes violating messages
README.md - Discord → Automod integration: sends automod events