Slack conversations.replies Thread Export Bot Prompt
Walk a full Slack thread via conversations.replies (handling pagination and the parent-message quirk) to export an incident discussion into a structured timeline or ticket body
- Target user
- Engineers building incident-timeline and thread-to-doc automation
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps and message-export tooling on the Slack Web API and Bolt.
I will provide:
- How a thread is identified (a shortcut on the parent message, a channel + thread_ts, or a permalink)
- The output shape I need (markdown timeline, ticket body, JSON of {author, ts, text})
- My scopes and whether the bot is a member of the source channels
Your job:
1. **Thread resolution** — show how to get `channel` + `thread_ts`, including parsing a permalink, and confirm `conversations:history` / `groups:history` scope coverage for the channel type.
2. **Full pagination walk** — implement the `conversations.replies` cursor loop; explain that the first reply returned is the parent message and that `has_more` + `response_metadata.next_cursor` drive paging.
3. **Author and timestamp enrichment** — resolve user IDs to display names via a cached `users.info` lookup, and convert `ts` to readable timestamps.
4. **Content normalization** — convert mrkdwn, resolve `<@U…>` mentions and `<http…|label>` links, and handle attachments/files references.
5. **Rate-limit safety** — conversations.replies is Tier 3; show the backoff loop honoring `Retry-After` for long threads.
6. **Broadcast and edited messages** — handle `subtype: thread_broadcast` and edited/deleted messages so the export reflects reality.
7. **Output assembly** — build the requested format with the parent message as the header and replies in order.
Output as: a Bolt module (or standalone script) that takes a thread reference and returns the structured export, plus a note on the parent-message-first pagination quirk.
Caution: conversations.replies returns the parent as the first element on every page-one call — naively concatenating pages will duplicate the parent; dedupe by ts.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack App Rate-Limit Tier & Capacity Planning Prompt
Model a Slack app's request budget across method tiers, size fan-out and polling under per-workspace limits, and design a token-bucket schedule that never trips 429s.
-
Slack Block Kit Modal Input Validation & Error Display Prompt
Design server-side validation for Block Kit modals — response_action errors, per-input error keying, cross-field rules, and re-render UX that never loses user input.
-
Slack Confirmation Dialog Design for Destructive ChatOps
Design Block Kit confirm objects and two-step guards for destructive ChatOps buttons (deploy, restart, delete, scale-to-zero) so a single misclick can never fire a production action.
-
Slack Live Progress Bar with chat.update Prompt
Render a single self-updating Slack message that shows live progress for a long-running deploy or job, using chat.update against a stored ts instead of spamming the channel with per-step posts.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.