Reddit/moderation
@webframp/reddit/moderationv2026.05.24.1
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_modqueue02Models
@webframp/reddit/moderationv2026.05.24.1reddit/moderation.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| subreddit | string | Subreddit name (without r/ prefix) |
| clientId | string | Reddit OAuth2 application client ID |
| clientSecret | string | Reddit OAuth2 application client secret |
| username | string | Reddit account username |
| password | string | Reddit account password |
| userAgent | string | User-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)
| Argument | Type | Description |
|---|---|---|
| type | enum | Filter modqueue by item type |
| limit | number | Maximum number of items to return |
fn get_reports(limit: number)
Retrieve user-reported content awaiting moderator action
| Argument | Type | Description |
|---|---|---|
| limit | number | Maximum 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
| Argument | Type | Description |
|---|---|---|
| action? | string | Filter by action type (e.g. removecomment, approvelink, banuser) |
| mod? | string | Filter by moderator username |
| limit | number | Maximum number of log entries to return |
fn list_comments(sort: enum, limit: number)
List recent comments in the subreddit
| Argument | Type | Description |
|---|---|---|
| sort | enum | Sort order for comments |
| limit | number | Maximum number of comments to return |
fn list_posts(sort: enum, limit: number)
List posts in the subreddit by sort order
| Argument | Type | Description |
|---|---|---|
| sort | enum | Sort order for posts |
| limit | number | Maximum number of posts to return |
fn get_user_info(username: string)
Retrieve information about a specific Reddit user
| Argument | Type | Description |
|---|---|---|
| username | string | Reddit username to look up |
fn approve(thingId: string)
Approve a post or comment from the modqueue
| Argument | Type | Description |
|---|---|---|
| thingId | string | Reddit 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)
| Argument | Type | Description |
|---|---|---|
| thingId | string | Reddit fullname of the item to remove (e.g. t3_abc123 or t1_xyz789) |
| spam | boolean | Mark as spam (default: false) |
| modNote? | string | Internal mod note (up to 100 chars) |
fn ban_user(username: string, duration?: number, banReason?: string, modNote?: string)
Ban a user from the subreddit
| Argument | Type | Description |
|---|---|---|
| username | string | Reddit username to ban |
| duration? | number | Ban duration in days (omit for permanent) |
| banReason? | string | Reason shown to the banned user |
| modNote? | string | Internal 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)
| Argument | Type | Description |
|---|---|---|
| to | string | Recipient username |
| subject | string | Message subject |
| body | string | Message body (markdown supported) |
fn flair_post(thingId: string, flairTemplateId: string)
Apply a flair template to a post
| Argument | Type | Description |
|---|---|---|
| thingId | string | Reddit fullname of the post to flair (e.g. t3_abc123) |
| flairTemplateId | string | Flair 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)
03Previous Versions
2026.05.23.1May 24, 2026
04Stats
A
100 / 100
Downloads
1
Archive size
18.5 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
05Platforms
06Labels