Closed brokenprogrammer closed 6 years ago
You get the ApiError off the response handler I wrote? That might be worth introspecting on
On Fri, Sep 7, 2018, 04:33 Oskar Mendel notifications@github.com wrote:
Used a small testing bot but its unable to edit its own messages. I'm putting this on hold for now or incase someone else wants to attempt to fix the issue.
According to the discord api:
400 (BAD REQUEST) | The request was improperly formatted, or the server couldn't understand it
The following request uri was used:
https://discordapp.com/api/channels/481177024707428372/messages/487528139518377995
Which doesn't seem to be a problem.
And the json body sent as a test looks like the following:
{"content":"Test Message","embed":null}
Together with the alternative:
{"content":"Test Message"}
Documentation for Edit Message is available here: https://discordapp.com/developers/docs/resources/channel#edit-message
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brokenprogrammer/BrokenDiscord/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/APKSuElZf1uonNX6U7TCcTn3l6RYZM2pks5uYi9MgaJpZM4WeaAh .
absolutely sure you're running a PATCH request?
On Fri, Sep 7, 2018, 04:33 Oskar Mendel notifications@github.com wrote:
Used a small testing bot but its unable to edit its own messages. I'm putting this on hold for now or incase someone else wants to attempt to fix the issue.
According to the discord api:
400 (BAD REQUEST) | The request was improperly formatted, or the server couldn't understand it
The following request uri was used:
https://discordapp.com/api/channels/481177024707428372/messages/487528139518377995
Which doesn't seem to be a problem.
And the json body sent as a test looks like the following:
{"content":"Test Message","embed":null}
Together with the alternative:
{"content":"Test Message"}
Documentation for Edit Message is available here: https://discordapp.com/developers/docs/resources/channel#edit-message
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/brokenprogrammer/BrokenDiscord/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/APKSuElZf1uonNX6U7TCcTn3l6RYZM2pks5uYi9MgaJpZM4WeaAh .
Yes I just double checked it is a PATCH request, This is the function:
member this.EditMessage chid mgid (args : WebEditMessageParams) =
restPatchCall<_,Message> token <| messageEndpoint chid mgid <| Some args
Called the following way using breakpoint on the res:
let edit : WebEditMessageParams = {content = "Test edit"; embed = None}
let res = client.EditMessage message.channelId message.id edit |> run
Returned is not the ApiError you wrote but and empty Result. The ErrorValue is null.
And the toJson on that payload generated a valid body? No "None"s in there?
Issue was a missing Content-Type header which was added: Here
Used a small testing bot but its unable to edit its own messages. I'm putting this on hold for now or incase someone else wants to attempt to fix the issue.
According to the discord api:
The following request uri was used:
Which doesn't seem to be a problem.
And the json body sent as a test looks like the following:
Together with the alternative:
Documentation for Edit Message is available here: https://discordapp.com/developers/docs/resources/channel#edit-message
This issue seems to also affect the following (The ones I know of):