Summary
Despite the fact that
a PATCH HTTP method should apply partial modification to a resource, using the `PATCH
/channels/{channel.id}/messages/{message.id}` endpoint with only "content" field results in both the message content and embeds being fully replaced by the given payload, i.e. it affects fields that weren't provided. This is unexpected for a PATCH endpoint (+ it differs from Discord's behaviour of the same endpoint).
I'd only expect embeds to be removed, if
"embeds": [] was included in the payload.
The same problem does not seem to appear, when doing the opposite - I can edit only embeds without the content being removed.
NOTE: This is a repost of
#280 - I can still reproduce the issue after Fluxer V2 release.
Steps to reproduce
- Send the following message to the channel (`POST
/channels/{channel.id}/messages`)
{"content": "Test", "embeds": [{"description": "text"}]}
- See that it has content and an embed:image
- Edit the message created in step 1 (`PATCH
/channels/{channel.id}/messages/{message.id}`)
- See that it no longer has an embed:image
---
Note that the same issue does not occur, if instead of editing content, you were to modify the embed with the following payload in step 3:
{"embeds": [{"description": "edit"}]}
The content remains:
image
(side note: there's no "(edited)" indicator in such a case)
Environment
This is an API issue, so not relevant.
Logs or screenshots
Already posted above
4 comments
Comment by Rex
Comment by @PiggyPlex
Comment by @Jackenmen
Comment by @Jackenmen