feat(discord): add discord-dump script + dumping-channel-content skill (was agents#226) - #588
alex-nsheaps[bot] wants to merge 3 commits into
Conversation
Moves scripts/discord-dump.py from nsheaps/agents PR #226 into the discord plugin. Stdlib-only Python 3 tool that exports channel/thread messages to JSONL via the Discord REST API v10. Supports --verify flag, date/user filters, guild-wide dumps, and forum thread traversal. Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
Adds a new skill describing when and how to use discord-dump.py for channel/thread exports: invocation examples, all CLI args, output format, --verify flag, and Discord auth setup. Co-Authored-By: Agent Alex Picard <alex-nsheaps[bot]@users.noreply.github.com>
Plugin Version PreviewPreview only — plugin versions and
|
There was a problem hiding this comment.
❌ Some changes need to be made — re-review finds the same issues unaddressed (no new commits since last review)
❌ SKILL.md frontmatter never opens with --- (line 1 is a commented setext heading) → name/description/allowed-tools won't parse — thread
❌ "Starter message handling" doc says the starter is skipped; the code includes it — thread
⚠️ Dead list_channel_threads with a literal {{guild_id}} placeholder request — thread
⚠️ --verify false-fails when --start/--user/--exclude-user are used — thread
⚠️ --all --with-threads silently drops archived threads — thread
⚠️ Version bumped in package.json, not the plugin.json the marketplace reads — thread
✅ Stdlib-only, sensible rate-limit/retry handling, JSONL output, chronological ordering
🖱️ Click to expand for full details
SKILL.md frontmatter never opens with --- (line 1 is a commented setext heading) → name/description/allowed-tools won't parse — thread❌ "Starter message handling" doc says the starter is skipped; the code includes it — thread
list_channel_threads with a literal {{guild_id}} placeholder request — thread--verify false-fails when --start/--user/--exclude-user are used — thread--all --with-threads silently drops archived threads — threadpackage.json, not the plugin.json the marketplace reads — thread✅ Stdlib-only, sensible rate-limit/retry handling, JSONL output, chronological ordering
This is a re-review. The PR head (fdd429d) is unchanged since my prior review and none of the six open threads have replies or fixes, so every finding below still stands. Details remain in the existing inline threads (linked above) rather than being re-posted.
Code Quality
The script is well-organized for a stdlib-only tool — clean DiscordClient with 429/5xx backoff and proactive bucket cooldown, chronological pagination, and a thoughtful --verify mode. Two correctness/accuracy problems and some cleanup keep the score at 70%:
- Broken skill frontmatter (blocking).
dumping-channel-content/SKILL.mddoesn't start with---; the<!-- UPSTREAM: discord -->comment precedes the fence, andmise run lintthen folded it into a## …setext heading and mangledallowed-toolsintoBash(python3 \*). Verified on disk withcat -A— the metadata will not be parsed. - Doc contradicts code (blocking). The "Starter message handling" section claims the starter message is skipped to avoid double-counting;
dump_to_filedeliberately fetches and includes it. - Dead code with a broken placeholder.
list_channel_threadsis unused and issues a request to the literal path/guilds/{guild_id}/threads/active. Remove per YAGNI. - Minor:
iter_channel_messagestakes an unusedis_threadparam and ends with an unreachablereturn+ stale comment; theverifyPASS line prints'present'on both ternary branches.
Correctness / Completeness
--verify+ filters → false FAIL. Verification flags any message older thanmin_id, but--start/--user/--exclude-userlegitimately exclude older messages, so a correct filtered dump exits non-zero.--all --with-threadsomits archived threads while the single-channel path includes them — an inconsistent completeness gap.
Versioning / Repo conventions
- The bump landed in the MCP server's
package.json;.claude-plugin/plugin.json(the marketplace source of truth) is still0.1.0on disk, so the intended0.2.0minor bump won't take effect (auto-bump on merge would only apply a patch). SPEC.mdstill lists onlyaccess,configure,forum-thread-creation— the newdumping-channel-contentskill isn't recorded (spec drift; see theplugin-spec-syncskill).
Security
No material concerns — the bot token is read from an env var and never echoed, requests are GET-only against the official API, and the User-Agent is static (it does still point at the old nsheaps/agents repo, cosmetic). 90%.
Simplicity
78% — dropping the dead list_channel_threads and the unused is_thread param/unreachable return would tighten the module without losing functionality.
Confidence
88% — I re-verified the frontmatter breakage byte-for-byte (cat -A), confirmed plugin.json is still 0.1.0, and confirmed SPEC.md omits the new skill. I did not run the script against a live Discord guild, so the network/pagination paths are reasoned about, not executed.
Recommended follow-ups (non-blocking):
- Update
plugins/discord/SPEC.mdto include the new skill (or runplugin-spec-sync). - Refresh the static
User-AgentURL fromnsheaps/agentstonsheaps/ai-mktpl. - Remove the unused
is_threadparameter and the unreachable trailingreturniniter_channel_messages.
To improve future reviews I'd benefit from access to Bash(python3 ...) in a sandbox with a test Discord token so I can exercise the pagination/--verify paths rather than reasoning about them.
Footnotes
-
Workflow Run: nsheaps/ai-mktpl actions run 27225449500 ↩
-
Discord channel-types / message pagination reference: Discord Developer Docs — Channel ↩
Summary
discord-dump.pyfrom nsheaps/agents#226 intoplugins/discord/scripts/discord-dump.pyper Nate's directive 2026-06-09 17:45Zplugins/discord/skills/dumping-channel-content/SKILL.mddescribing when to use channel dumping, all CLI args, output format,--verifyflag, and Discord auth setupplugins/discord/package.jsonversion0.1.0 → 0.2.0Script capabilities
The script (
discord-dump.py) exports Discord channels/threads to JSONL via the REST API v10. Stdlib-only (no external deps). Key features: guild-wide dumps (--all), thread traversal (--with-threads), date/user filters, forum thread support, and--verifyfor completeness validation.Test plan
python3 plugins/discord/scripts/discord-dump.py --help— confirm all flags documented in SKILL.md appear--verify— confirm output JSONL and no assertion errors🤖 Generated with Claude Code