andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
502 stars 71 forks source link

Incorrect http response type check for UpdateGuildMemberBuilder #378

Closed m-vinc closed 3 years ago

m-vinc commented 3 years ago

Describe the bug When using the UpdateGuildMemberBuilder to update a member, the Discord API is returning a 200 OK (https://discord.com/developers/docs/resources/guild#modify-guild-member) but in the code there is a middleware on the rest client (https://github.com/andersfylling/disgord/blob/develop/member.go#L85) which check if the response type is a 204 No content, so we're received an untyped error while the operation is sucessfully made !

Desktop (please complete the following information):

andersfylling commented 3 years ago

nice catch, I'll update these to do a range check so it's a little more flexible.

andersfylling commented 3 years ago

fixed here: https://github.com/andersfylling/disgord/commit/bf4fdc59adfe84421e66b5e2d8e4103e46fcda2a

m-vinc commented 3 years ago

Thanks you, next time I'll try to do a PR !