Reddit/moderation
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 vault create local_encryption reddit # once, if you have no vault yet
swamp vault put reddit CLIENT_SECRET # prompts; never pass secrets inline
swamp vault put reddit PASSWORD
swamp model create @webframp/reddit/moderation reddit-mod \
--global-arg subreddit=aoe4 \
--global-arg clientId=YOUR_CLIENT_ID \
--global-arg 'clientSecret=${{ vault.get("reddit", "CLIENT_SECRET") }}' \
--global-arg username=yourbot \
--global-arg 'password=${{ vault.get("reddit", "PASSWORD") }}' \
--global-arg userAgent="swamp:aoe4mod:v1.0 (by /u/yourbot)"
swamp model method run reddit-mod get_modqueue2026.11.03.1
Changed: Bump zod 4.6.5 → 4.6.7
2026.10.21.1
Fixed: The README and the registry Quick Start showed vault://reddit/...
global arguments and a vault set subcommand. Neither is swamp syntax: swamp
has no vault set, and it does not resolve vault:// strings. Because
clientSecret and password are marked sensitive, swamp refuses a literal
value for them, so swamp model create rejected the documented command
outright; clientId and username would have been passed through as the
literal vault:// text. The docs now store the client secret and password with
swamp vault put reddit <KEY> (interactive prompt) and wire them with
${{ vault.get("reddit", "...") }}.
Changed: Documentation only otherwise: the clientSecret and password
global argument descriptions now say to supply the value through vault.get.
Upgrade note: No code, schema, or behavioral changes. The model version moves to 2026.10.21.1 with an identity upgrade. The old example could not create an instance, so existing instances need no change.
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. Supply it as ${{ vault.get("reddit", "CLIENT_SECRET") }}; never pass the literal value |
| username | string | Reddit account username |
| password | string | Reddit account password. Supply it as ${{ vault.get("reddit", "PASSWORD") }}; never pass the literal value |
| userAgent | string | User-Agent string for Reddit API requests (e.g. 'swamp:modbot:v1.0 by /u/yourname') |
| Argument | Type | Description |
|---|---|---|
| type? | enum | Filter modqueue by item type |
| limit? | number | Maximum number of items to return |
| Argument | Type | Description |
|---|---|---|
| limit? | number | Maximum number of reported items to return |
| 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 |
| Argument | Type | Description |
|---|---|---|
| sort? | enum | Sort order for comments |
| limit? | number | Maximum number of comments to return |
| Argument | Type | Description |
|---|---|---|
| sort? | enum | Sort order for posts |
| limit? | number | Maximum number of posts to return |
| Argument | Type | Description |
|---|---|---|
| username | string | Reddit username to look up |
| Argument | Type | Description |
|---|---|---|
| thingId | string | Reddit fullname of the item to approve (e.g. t3_abc123 or t1_xyz789) |
| 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) |
| 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 |
| Argument | Type | Description |
|---|---|---|
| to | string | Recipient username |
| subject | string | Message subject |
| body | string | Message body (markdown supported) |
| Argument | Type | Description |
|---|---|---|
| thingId | string | Reddit fullname of the post to flair (e.g. t3_abc123) |
| flairTemplateId | string | Flair template ID to apply |
Resources
2026.10.21.1
Fixed: The README and the registry Quick Start showed vault://reddit/...
global arguments and a vault set subcommand. Neither is swamp syntax: swamp
has no vault set, and it does not resolve vault:// strings. Because
clientSecret and password are marked sensitive, swamp refuses a literal
value for them, so swamp model create rejected the documented command
outright; clientId and username would have been passed through as the
literal vault:// text. The docs now store the client secret and password with
swamp vault put reddit <KEY> (interactive prompt) and wire them with
${{ vault.get("reddit", "...") }}.
Changed: Documentation only otherwise: the clientSecret and password
global argument descriptions now say to supply the value through vault.get.
Upgrade note: No code, schema, or behavioral changes. The model version moves to 2026.10.21.1 with an identity upgrade. The old example could not create an instance, so existing instances need no change.
2026.10.14.1
Added: The manifest now declares license: Apache-2.0 (SPDX). The registry quality rubric scores a declared license separately from the bundled LICENSE.md.
Upgrade note: Metadata only. No code, schema, or behavioral changes.
2026.09.18.1
Upgrade note: Normalized npm:zod dependency version to 4.6.5 across the
repo. No behavioral changes in this extension.
2026.09.18.1
Upgrade note: Normalized npm:zod dependency version to 4.6.5 across the
repo. No behavioral changes in this extension.
2026.09.15.1
Changed: Bump zod 4.4.3 → 4.6.5
2026.08.28.1
Changed: Normalized the extension license to Apache-2.0 and corrected the copyright holder to "Sean Escriva". Extensions that previously shipped an MIT LICENSE.md are now Apache-2.0, consistent with the repository root and every other extension. No code or behavioral changes.
Upgrade note: License text only. No API, schema, or runtime behavior changed.
2026.08.26.3
Fixed: Restored inline npm:zod@4.4.3 import specifiers so the registry
quality scorer can resolve dependencies and score the extension. An earlier
release used a bare "zod" import-map specifier, which published but scored as
unscored.
Changed: Retained explicit compilerOptions.strict in deno.json. No
behavioral or schema changes.
2026.08.28.1
Changed: Normalized the extension license to Apache-2.0 and corrected the copyright holder to "Sean Escriva". Extensions that previously shipped an MIT LICENSE.md are now Apache-2.0, consistent with the repository root and every other extension. No code or behavioral changes.
Upgrade note: License text only. No API, schema, or runtime behavior changed.
2026.08.26.3
Fixed: Restored inline npm:zod@4.4.3 import specifiers so the registry
quality scorer can resolve dependencies and score the extension. An earlier
release used a bare "zod" import-map specifier, which published but scored as
unscored.
Changed: Retained explicit compilerOptions.strict in deno.json. No
behavioral or schema changes.
2026.08.26.3
Fixed: Restored inline npm:zod@4.4.3 import specifiers so the registry
quality scorer can resolve dependencies and score the extension. An earlier
release used a bare "zod" import-map specifier, which published but scored as
unscored.
Changed: Retained explicit compilerOptions.strict in deno.json. No
behavioral or schema changes.
2026.08.26.1
Fixed: Added missing description field to upgrade entry for version
2026.08.24.2. The omission caused swamp extension pull to fail with a catalog
validation error ("upgrades.N.description: Invalid input: expected string,
received undefined").
2026.08.24.3
Added: Output metadata attributes for observability.
durationMs: Method execution duration in milliseconds.collectedBy: Extension name that produced the data.fetchedAt: ISO 8601 timestamp when data was fetched (added to resources that previously lacked it).
2026.08.24.2
Added Troubleshooting section documenting rate-limit self-throttle, 401 auto-reauthentication, MAX_PAGES with method limit caps, no HTTP timeout, Reddit-level error checking on 200 responses, and per-invocation token lifecycle.
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.
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
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
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.
Modified 1 behaviors
- 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
- Docs keep secrets in a vault1/1earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned