edit-message: expose attachments array
From the documentation:
To remove or replace files you will have to supply the attachments field which specifies the files to retain on the message after edit.
In particular, this allows editing a message with an embed that referenced a file uploaded in the same message, without the file now showing up outside the embed. This issue had been previously reported here, and the workaround from one of the responses, translated to racket-cord:
(http:edit-message myclient channel-id message-id #:embed updated-embed #:attachments null)
I think it's related to this oddity.
The way the Discord API handles attachments is not great IMO, but since racket-cord is pretty low level, I guess we should just expose it the way it is?
For future reference, the workaround to the problem I described when editing an embed message, is not to remove the attachment, but to use the same attachment://filename style reference in the edited embed as was used when creating the message with the attachment in the first place.
Removing the attachment can invalidate the attachment's CDN URL - it's probably deleted on Discord's backend - if the message being edited is the only reference to the attachment.
As for this PR, some people may still find it useful to be able to remove or edit attachments from messages, but I don't have a use case for it right now :slightly_smiling_face: