Skip to content

feat(messages): include files field in message JSON output#120

Merged
piekstra merged 1 commit intomainfrom
piekstra/119-include-files-in-message-json
Mar 2, 2026
Merged

feat(messages): include files field in message JSON output#120
piekstra merged 1 commit intomainfrom
piekstra/119-include-files-in-message-json

Conversation

@piekstra
Copy link
Collaborator

@piekstra piekstra commented Mar 2, 2026

Summary

  • Add File struct and Files field to Message so file attachment metadata from the Slack API is preserved in JSON output
  • Covers messages thread, messages history, and any other command returning Message objects

Why

The Message struct had no Files field, so file attachment data returned by the Slack API (conversations.replies, conversations.history) was silently dropped during JSON unmarshalling. A message like "see the screenshot below" appeared identical to a plain text message in --output json, losing important context for automated consumers.

Test plan

  • New test TestRunThread_JSONIncludesFiles verifies files round-trip through JSON output
  • Existing tests pass (reactions, history, thread)
  • Linter clean (0 issues)

Closes #119

The Message struct was missing a Files field, so file attachment metadata
from the Slack API (conversations.replies, conversations.history) was
silently dropped during JSON unmarshalling. Messages with attachments
appeared identical to plain text messages in JSON output.

Add a File struct with the key fields (id, name, mimetype, filetype,
size, url_private, url_private_download, permalink) and a Files field
to Message so file data is preserved.

Closes #119
@piekstra piekstra merged commit e1504b0 into main Mar 2, 2026
2 checks passed
@piekstra piekstra deleted the piekstra/119-include-files-in-message-json branch March 2, 2026 13:49
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.

messages thread: include files field in JSON output

1 participant