💡 Inspiration
Moderating a growing subreddit is an exhausting, thankless job. The mental overhead of tracking "who did what" and "how many times they've broken the rules" usually forces moderation teams to rely on messy third-party spreadsheets or cumbersome manual Mod Notes. We were inspired to build a completely native, frictionless solution that handles the bureaucratic nightmare of community "Three-Strikes" policies entirely in the background.
⚙️ What it does
ModGuard Pro is an automated escalation engine built directly into the native Reddit interface. It silently listens to the mod-action event stream. When a moderator clicks "Remove" on a rule-breaking comment or post, ModGuard automatically assigns a "strike" to that user's internal record.
It operates on a fully customizable escalation ladder:
- Strike 1: The bot drops a public sticky-comment replying to the removed content, warning the user they are on thin ice.
- Strike 3: The bot automatically executes a 3-day temporary ban via the Reddit API.
- Strike 5: The bot executes a permanent ban.
Beyond automation, Moderators get a custom suite of UI tools injected straight into the subreddit:
- Strike Management: Custom
...overflow menu actions allow mods to manually Add/Clear Strikes, or pull up a beautiful Popup Modal displaying a user's exact strike history. - The Leaderboard: A custom ModGuard Stats menu item dynamically generates a popup Leaderboard showcasing the Top 5 worst repeat offenders in the community.
- Background Jobs: A weekly cron-job automatically drafts a "Top Offenders Digest" and sends it to Modmail to keep the team informed, while a daily cron-job "decays" (removes) strikes older than 90 days to forgive rehabilitated users.
🛠️ How we built it
We built ModGuard Pro entirely on the Devvit Web Platform using TypeScript and the Hono web framework for routing.
- Database: We utilized
@devvit/redisto persist the stateful strike counts, user histories, and leaderboards. - API Integration: We heavily relied on the
@devvit/web/servernative Reddit client to execute API calls (submitComment,banUser,sendPrivateMessage, andcreateConversation) without needing to manage complex OAuth handshakes. - Interface: The custom Modal UIs were built utilizing Devvit's native form and toast components to ensure they seamlessly matched Reddit's design system.
🚧 Challenges we ran into
Handling the raw mod-action webhook JSON payload was notoriously tricky. The exact shape of the object (specifically determining the target user vs. the target author) wasn't always guaranteed, requiring us to build robust, defensive fallback parsing logic.
Additionally, we had to navigate several beta quirks on the Developer Portal that occasionally hid our app's settings configurations, forcing us to engineer robust hardcoded defaults to ensure the app never crashed during playtesting. Finally, working within the constraints of Devvit's strict UI form components to build a "Leaderboard" required some highly creative engineering utilizing read-only fields!
🧠 What we learned
We learned the immense power of having a database (Redis) and a first-party API client natively integrated into the hosting platform. It drastically reduced our boilerplate code and allowed us to focus purely on business logic. We also learned how to successfully architect asynchronous background cron jobs (scheduler) inside a serverless-like Reddit environment.
🚀 What's next for ModGuard Pro
We plan to hook ModGuard Pro up to an LLM API to analyze the context and severity of the removed comments in order to dynamically weigh the strikes (e.g., a simple spam link is 1 strike, but a severe toxicity rule-break is instantly 3 strikes). As the Devvit platform matures, we also want to expand our Modal Leaderboard into a full, interactive analytics dashboard directly inside the subreddit feed!

Log in or sign up for Devpost to join the conversation.