← Back to library

Discord 纯媒体发送去掉空 content 避免 400(PR #9507)

解决“带图发送经常 400 Bad Request”的场景:纯媒体请求不再携带空 `content` 字段,减少 multipart 负载兼容问题。

GITHUBDiscovered 2026-02-13Author leszekszpunar
Prerequisites
  • You use Discord media sending and have seen occasional 400 errors on media-only payloads.
  • Runtime can be upgraded to include PR #9507.
Steps
  1. Upgrade to a build including PR #9507 and restart gateway.
  2. Run three cases: media-only, media+caption, and text-only, then capture HTTP status for each.
  3. Inspect outbound payloads to confirm media-only request omits empty `content` field.
  4. Keep one regression test for reply/reference path to ensure message_reference still works when provided.
  5. Monitor error-rate trend for 24h to validate fix impact in production traffic.
Commands
openclaw gateway status
openclaw gateway restart
openclaw status
Verify

Media-only messages are delivered without 400 errors, while caption/text variants continue working.

Caveats
  • Large files and CDN/transcoding limits can still cause failures unrelated to empty content fields.
  • Proxy/middleware rewriting multipart payloads may reintroduce similar symptoms(需验证)。
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post