Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Commit

Permalink
remove http code requirement from member update (close #388)
Browse files Browse the repository at this point in the history
  • Loading branch information
andersfylling committed Mar 31, 2021
1 parent d07895e commit 29f9278
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions member.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package disgord
import (
"context"
"errors"
"net/http"

"github.com/andersfylling/disgord/internal/endpoint"
"github.com/andersfylling/disgord/internal/httd"
Expand Down Expand Up @@ -82,13 +81,7 @@ func (g guildMemberQueryBuilder) UpdateBuilder(flags ...Flag) UpdateGuildMemberB
Ctx: g.ctx,
Endpoint: endpoint.GuildMember(g.gid, g.uid),
ContentType: httd.ContentTypeJSON,
}, func(resp *http.Response, body []byte, err error) error {
if resp.StatusCode != http.StatusNoContent {
msg := "could not change attributes of member. Does the member exist, and do you have permissions?"
return errors.New(msg)
}
return nil
})
}, nil)

// TODO: cache member changes
return builder
Expand Down

0 comments on commit 29f9278

Please sign in to comment.