Inspiration

Managing community rate limits is one of the most tedious tasks for volunteer moderation teams. Historically, subreddits relied on the Python based ModeratelyHelpfulBot to enforce post frequency quotas. However, the legacy bot required moderators to maintain a server around the clock to poll the Reddit API continuously. Editing its configuration also meant modifying raw YAML text blocks on hidden wiki pages. We were inspired to bring this legacy powerhouse into the modern era. Reddit's Devvit platform offered the perfect opportunity to transition this tool from a continuous polling script into a zero cost, serverless application. Our goal was to completely port the aggressive enforcement capabilities of the original bot while wrapping it in a polished UI that any moderator could configure in seconds.

What it does

The application is an event driven moderation tool that enforces subreddit posting quotas, such as allowing a maximum of two posts every 72 hours. It evaluates user quotas on a true rolling chronological basis. It features intelligent historical state validation, meaning it ignores posts that were instantly filtered by AutoModerator or deleted by the user within a configurable grace period. Beyond basic rate limiting, it tracks repeat offenders to issue automated bans and intercepts modmail to auto reply to users who have no logged activity. Moderators are also given real time UI tools, including a custom Mod Menu button to grant users a one time hallpass to bypass the filters. We designed the application to be highly configurable, allowing moderation teams to easily fine tune quotas, exemptions and dynamic removal notifications directly through Reddit's native settings interface.

How we built it

The project is built entirely in TypeScript using the Devvit public API. Rather than running continuous background loops, the bot operates purely on Devvit triggers like onPostSubmit and onModMail. It utilizes the Devvit Redis plugin for robust state management. To track rolling windows, the bot stores user post timestamps in JSON arrays within Redis. It also manages independent time to live states for automated ban tracking and manual exemptions. For configuration, we bypassed standard text inputs by building custom Mod Menu forms. This allows the bot to query the live rules of the subreddit and present a clean dropdown menu for assigning native backend Removal Reasons.

Challenges we ran into

Porting a continuous daemon to an event driven model introduced severe race conditions. Because the post submission trigger fires instantly, the API will report that a post is perfectly valid even if AutoModerator deletes it two seconds later. We solved this by building a Historical State Validator. Instead of just checking the current post, the bot loops backward through the Redis array and verifies the active state of previous posts. We also encountered a trap with zombie posts. When a user deletes their own post, the Reddit API often returns a post object where the author is simply renamed to deleted instead of throwing a 404 error. We had to build a custom interceptor to route these anomalies through our grace period logic.

Accomplishments that we're proud of

We are incredibly proud of successfully translating a complex, state heavy Python script into a fully functional serverless architecture. Bridging the gap between the limitations of the standard Devvit settings page and the need for dynamic configuration was a major win. By shifting the removal reason configuration into a dedicated Mod Menu form, we were able to provide a significantly better user experience for the moderation team. The fact that the bot can accurately distinguish between a post removed by a human, a post filtered by a bot, and a post deleted by a user to fix a typo makes it a highly resilient moderation tool.

What we learned

This project was a deep dive into asynchronous data handling and platform constraints. We learned how to integrate Redis time series tracking into a serverless environment and how to gracefully handle data migration, specifically transitioning legacy absolute counters into chronological JSON arrays without crashing live triggers. We also learned how to creatively navigate UI boundaries. Realizing that the standard settings page could not asynchronously load live rules forced us to completely rethink how a moderator interacts with the app during the initial setup phase.

What's next for Moderately Helpful Bot Port

The immediate next step is to wait for the Devvit platform so that the app can be updated with a custom profile icon and fully transition to the modern web architecture. Beyond that, we plan to expand the hallpass system to allow moderators to grant multi use passes. Finally, we want to publish this to the broader Devvit App Directory so any moderation team can deploy an enterprise grade rate limiter with just a few clicks, completely eliminating the need for external hosting.

Built With

Share this project:

Updates