Skip to content

feat(discord): add thread export command#794

Open
clsung wants to merge 1 commit into
openabdev:mainfrom
clsung:feat/discord-export-thread
Open

feat(discord): add thread export command#794
clsung wants to merge 1 commit into
openabdev:mainfrom
clsung:feat/discord-export-thread

Conversation

@clsung
Copy link
Copy Markdown
Contributor

@clsung clsung commented May 11, 2026

What problem does this solve?

Discord threads can contain useful debugging or design context, but users currently need to manually copy messages if they want a plain-text archive to share, search, or attach elsewhere.

Closes #

Discord Discussion URL: https://discord.com/channels/1491295327620169908/1503358908331462677

At a Glance

Discord /export-thread
  -> validate allowed user + allowed thread/DM
  -> page through Discord message history
  -> format messages + attachment URLs as text
  -> return ephemeral .txt follow-up attachment

Prior Art & Industry Research

Not applicable — this is a small Discord adapter convenience command, not a new architecture, scheduler, delivery mechanism, or persistence model.

OpenClaw: Not applicable.

Hermes Agent: Not applicable.

Other references (optional): Discord message history and interaction attachment APIs via serenity.

Proposed Solution

Add a Discord slash command, /export-thread, that exports the current allowed thread or enabled DM as a .txt transcript. The export includes timestamps, author names and IDs, message text, and attachment URLs.

The command returns the transcript as an ephemeral follow-up attachment so only the invoking user sees the generated file.

Why this approach?

This keeps export behavior in the Discord adapter where message history and interaction response APIs already live. It does not involve the agent session, so thread contents are not sent to the coding agent merely to produce an export.

Known limitations:

  • Exports are capped at 5000 messages.
  • Very large transcripts are truncated to fit Discord's interaction attachment size limit.
  • Attachment contents are not downloaded; the transcript records attachment metadata and URLs.

Alternatives Considered

  • Forwarding the export request to the agent: rejected because exporting Discord history is adapter-level behavior and should not expose thread history to the agent unnecessarily.
  • Sending transcript as message chunks: rejected because long exports are easier to consume as a text attachment and avoid cluttering the thread.

Validation

  • cargo check passes
  • cargo test passes (including new tests)
  • cargo clippy clean
  • Manual testing — not run in this environment

Notes: local Rust validation was not available in this environment because cargo and rustfmt are not installed. git diff --check passes.

@clsung clsung requested a review from thepagent as a code owner May 11, 2026 15:11
@github-actions github-actions Bot added the pending-screening PR awaiting automated screening label May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants