Skip to content

Add export_thread message action - #273

Open
gonzaloserrano wants to merge 1 commit into
mainfrom
claude/export-thread
Open

gonzaloserrano wants to merge 1 commit into
mainfrom
claude/export-thread

Conversation

@gonzaloserrano

Copy link
Copy Markdown
Contributor

Adds a staff-only "Export thread" message action. It fetches the whole thread, renders it as Markdown and sends it to the requester as a .md file via DM. Useful for feeding thread content (e.g. specs) to an agent.

Behavior

  • Works from the parent message or any reply; the thread root is resolved from thread_ts.
  • Non-staff users get the existing "Not allowed" modal.
  • Runs in background (Slack's 3s ack limit). Reads with the bot token and falls back to the admin token when the bot is not a member of the channel. Errors are reported to the requester via DM.
  • Output: header (channel, link, message count, export time), then per message: author, UTC timestamp, text, and file links. User mentions, channel references, user groups, special mentions and links are converted from Slack mrkdwn to plain Markdown; HTML entities are unescaped.
  • Records a thread.exported metric.

Slack app config needed before deploy

  • Interactivity & Shortcuts: add a message shortcut with callback ID export_thread.
  • Bot token scopes: files:write, im:write, users:read (reinstall the app if any are added).

Testing

  • Unit tests for the mrkdwn → Markdown conversion and the rendered output (bot/export_thread_test.go).
  • go test ./... and make lint pass.
  • Not tested against a live workspace.

🤖 Generated with Claude Code

https://claude.ai/code/session_01A6cUQyKYWYm11Eha7pWKMS


Generated by Claude Code

Staff-only message action that fetches a whole thread, renders it as
Markdown (resolving mentions, channel references and links) and sends
it to the requester as a file via DM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A6cUQyKYWYm11Eha7pWKMS

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants