Skip to main content

Reddit/moderation

@webframp/reddit/moderationv2026.08.21.2· 1d agoMODELS
01README

Reddit moderation model for subreddit management.

Reddit moderation API wrapper providing modqueue inspection, user reports, moderator action logs, content listing, and moderation actions (approve, remove, ban, modmail, flair). Designed for automated moderation pipelines. Authentication via Reddit OAuth2 script app flow with credentials stored in swamp vault.

Quick Start

swamp extension pull @webframp/reddit/moderation
swamp model create @webframp/reddit/moderation reddit-mod \
  --global-arg subreddit=aoe4 \
  --global-arg clientId=vault://reddit/clientId \
  --global-arg clientSecret=vault://reddit/clientSecret \
  --global-arg username=vault://reddit/username \
  --global-arg password=vault://reddit/password \
  --global-arg userAgent="swamp:aoe4mod:v1.0 (by /u/yourbot)"
swamp model method run reddit-mod get_modqueue
02Release Notes

2026.08.21.2

Changed:

  • Reddit API errors (auth, GET, POST) now name the request path (and, for the OAuth2 token request, the account username) instead of only the HTTP status code and response body — e.g. "Reddit API GET /r/foo/about/modqueue failed (500): ..." instead of "Reddit API error (500): ...".
  • Moderation action failures (approve, remove, ban_user, send_modmail, flair_post) now include the target item id, username, or subreddit in the thrown error, instead of only the raw Reddit error payload — so a failed action is traceable back to what it was acting on.
  • A network-level failure (DNS, connection refused, TLS) talking to Reddit now surfaces which request it was attempting instead of a bare, unlabeled fetch exception.
03Models1
@webframp/reddit/moderationv2026.08.21.2reddit/moderation.ts

Global Arguments

ArgumentTypeDescription
subredditstringSubreddit name (without r/ prefix)
clientIdstringReddit OAuth2 application client ID
clientSecretstringReddit OAuth2 application client secret
usernamestringReddit account username
passwordstringReddit account password
userAgentstringUser-Agent string for Reddit API requests (e.g. 'swamp:modbot:v1.0 by /u/yourname')
fn get_modqueue(type: enum, limit: number)
Retrieve items in the moderation queue pending review (posts, comments, or all)
ArgumentTypeDescription
typeenumFilter modqueue by item type
limitnumberMaximum number of items to return
fn get_reports(limit: number)
Retrieve user-reported content awaiting moderator action
ArgumentTypeDescription
limitnumberMaximum number of reported items to return
fn get_modlog(action?: string, mod?: string, limit: number)
Retrieve the moderator action log, optionally filtered by action type or moderator
ArgumentTypeDescription
action?stringFilter by action type (e.g. removecomment, approvelink, banuser)
mod?stringFilter by moderator username
limitnumberMaximum number of log entries to return
fn list_comments(sort: enum, limit: number)
List recent comments in the subreddit
ArgumentTypeDescription
sortenumSort order for comments
limitnumberMaximum number of comments to return
fn list_posts(sort: enum, limit: number)
List posts in the subreddit by sort order
ArgumentTypeDescription
sortenumSort order for posts
limitnumberMaximum number of posts to return
fn get_user_info(username: string)
Retrieve information about a specific Reddit user
ArgumentTypeDescription
usernamestringReddit username to look up
fn approve(thingId: string)
Approve a post or comment from the modqueue
ArgumentTypeDescription
thingIdstringReddit fullname of the item to approve (e.g. t3_abc123 or t1_xyz789)
fn remove(thingId: string, spam: boolean, modNote?: string)
Remove a post or comment (with optional reason and mod note)
ArgumentTypeDescription
thingIdstringReddit fullname of the item to remove (e.g. t3_abc123 or t1_xyz789)
spambooleanMark as spam (default: false)
modNote?stringInternal mod note (up to 100 chars)
fn ban_user(username: string, duration?: number, banReason?: string, modNote?: string)
Ban a user from the subreddit
ArgumentTypeDescription
usernamestringReddit username to ban
duration?numberBan duration in days (omit for permanent)
banReason?stringReason shown to the banned user
modNote?stringInternal moderator note
fn send_modmail(to: string, subject: string, body: string)
Send a modmail message to a user (repeat calls create new data versions per recipient)
ArgumentTypeDescription
tostringRecipient username
subjectstringMessage subject
bodystringMessage body (markdown supported)
fn flair_post(thingId: string, flairTemplateId: string)
Apply a flair template to a post
ArgumentTypeDescription
thingIdstringReddit fullname of the post to flair (e.g. t3_abc123)
flairTemplateIdstringFlair template ID to apply

Resources

modqueue(infinite)— Items pending moderator review (posts and comments)
reports(infinite)— User-reported content awaiting moderator action
modlog(infinite)— Moderator action log entries
comments(infinite)— Subreddit comments
posts(infinite)— Subreddit posts
user_info(infinite)— Information about a specific Reddit user
action(infinite)— Result of a moderation action (approve, remove, ban, modmail, flair)
04Previous Versions7
2026.08.21.1

2026.08.21.1

Changed: Tightened clientId, clientSecret, username, password, and userAgent on the global-args schema to require non-empty strings. All five are required OAuth2/account credentials that the Reddit API never accepts empty — this catches misconfigured vault references or blank --global-arg values at model-create time instead of a confusing API failure on first method call.

2026.07.18.1

Added: An upgrades array entry (no-op) to moderation.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.

2026.07.16.1

Changed: Internal-only version bump. PR #183 touched deno.json (added a fmt:check task) and reordered a test-file import, but neither file is part of the published bundle — this release's published content is identical to 2026.06.23.1.

2026.07.18.1

2026.07.18.1

Added: An upgrades array entry (no-op) to moderation.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.

2026.07.16.1

Changed: Internal-only version bump. PR #183 touched deno.json (added a fmt:check task) and reordered a test-file import, but neither file is part of the published bundle — this release's published content is identical to 2026.06.23.1.

2026.07.16.1

2026.07.16.1

Changed: Internal-only version bump. PR #183 touched deno.json (added a fmt:check task) and reordered a test-file import, but neither file is part of the published bundle — this release's published content is identical to 2026.06.23.1.

2026.06.23.1
2026.06.15.1
2026.05.24.1

Modified 1 models

2026.05.23.1
05Stats
A
100 / 100
Downloads
1
Archive size
20.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
06Platforms
07Labels