🔒 Protected via Cloudflare Access

Discord Inline Content Research — Final Findings

The CDN Webview Discovery

When you tap a file attachment on Discord mobile, it opens in an in-app webview pointing to a CDN URL like: https://cdn.discordapp.com/attachments/{channel}/{msg}/{filename}

Key insight: Discord determines content-type from the file extension, NOT the Content-Type header you send. So:

The CDN sets Content-Disposition: attachment on non-image files, which forces download instead of inline rendering. This is a security measure — Discord doesn't want arbitrary HTML/JS running in their webview.

What's Actually Possible

1. Components V2 TextDisplay (BEST OPTION)

2. Components V2 Container with spoiler: true

3. File Preview (Desktop Only)

4. Image-based Content

What Discord Explicitly Prevents

Recommended Approach for Justin

For long-form inline content:

Use Components V2 with multiple TextDisplay blocks + Container:

{
  "container": {"accentColor": "#5865F2"},
  "blocks": [
    {"type": "text", "text": "## Summary\nBrief overview here"},
    {"type": "separator", "spacing": "small", "divider": true},
    {"type": "text", "text": "### Details\nLonger content here..."},
    {"type": "actions", "buttons": [{"label": "Full Report", "style": "link", "url": "https://..."}]}
  ]
}

For collapsible content:

No native Discord solution exists. Best alternatives:

  1. Spoiler container — blur/reveal (one-time)
  2. Button → edit message — requires interaction handler (custom code)
  3. Link to external page — host rendered HTML on CF Pages
  4. Split across messages — summary message + threaded detail

For > 4000 chars:

  1. Send .txt file alongside a V2 summary container
  2. Host on CF Pages and link from the message
  3. Split into multiple messages with V2 components