Path of Exile Automoderator | Reddit for Developers

Readme

History

This is a Devvit port of a classic API app that's been updated to use Devvit's scheduling and UI tools.

Description

A Reddit Devvit app that helps moderators review reported comments with AI assistance. It fetches items from your subreddit’s mod queue, classifies them with OpenAI, writes the results to a Google Sheet for human review, and then applies approve/remove actions on Reddit based on what’s in the sheet.

The spreadsheet is the review layer: you can edit reply IDs and other fields before running moderation, and you can turn off live changes to dry-run the whole loop.

How it works

  1. Fill — Pulls comments from the mod queue, runs OpenAI classification (violation type, suggested reply, thread context), and appends new rows to the Contents tab.
  2. Moderate — Reads rows from Contents, applies the corresponding Reddit actions (approve, remove with removal reason, ignore reports, etc.), and removes finished rows from the sheet.
  3. Schedule (optional) — When Automatically run comment moderation is on, fill and moderate run on the hourly cron schedule in devvit.json (scheduler.tasks).

Prerequisites

  • Moderator access on the subreddit where the app is installed.
  • A Google Cloud service account with access to Google Sheets.
  • A moderation spreadsheet (see step 1 below).

Setup

1. Create or copy the spreadsheet

Create a new Google Sheet or copy the template:

AI to Moderator template spreadsheet

The app expects at least these tabs:

  • Contents — Mod-queue items awaiting review (filled by the app).
  • Removal reasons — Maps reply IDs to moderator-facing removal reason text.

Keep the column headers from the template; the app matches columns by header text.

2. Create a Google Sheets service account

  1. Open Google Cloud Console.
  2. Create a project (or pick an existing one).
  3. Enable the Google Sheets API (APIs & Services → Library).
  4. Go to IAM & Admin → Service Accounts and create a service account.
  5. On the service account, open Keys → Add key → Create new key → JSON and download the key file.
  6. Open the JSON file and note the client_email value (e.g. something@project-id.iam.gserviceaccount.com). You will share the spreadsheet with this email.

The full JSON key is what you paste into app settings (next step). It must include at least client_email and private_key.

3. Share the spreadsheet with the service account

In Google Sheets, click Share and add the service account’s client_email as an Editor. Without this, the app cannot read or write the sheet.

4. Install the app and configure settings

Install the app on your subreddit from the Reddit Developer Portal, then open Install Settings for that subreddit (e.g. https://developers.reddit.com/r/your_subreddit/apps/aitomoderator3).

For initial testing, leave Make live changes off and Automatically run comment moderation off.

5. Test with the mod menu

In your subreddit (mod view), open the subreddit menu and use:

  1. Fill comment moderation sheet — Fetches mod-queue comments and appends classified rows to Contents. Confirm Make live changes in the form: turn it on only when you want real Sheet writes.
  2. Apply comment moderation from sheet — Reads Contents and applies actions on Reddit. Again, keep Make live changes off for a dry run.
  3. View job status — Shows progress and recent log lines for fill/moderate jobs.

Review the spreadsheet after a fill run. Adjust reply IDs or other fields if needed, then run moderate (with Make live changes on when you are ready for real actions).

6. Enable the scheduled job

When manual runs look good:

  1. Set Make live changes to on in Install Settings (or enable it per run from the menu form).
  2. Turn on Automatically run comment moderation.

Cron timing is defined in devvit.json under scheduler.tasks. Menu-triggered runs always work; cron runs are skipped when Automatically run comment moderation is off.

Development

npm install
npm run dev      # playtest against the dev subreddit in devvit.json
npm run build
npm run deploy   # type-check, lint, upload

See devvit.md for details on devvit.json, permissions, and settings.

About this app