Skip to content

Commit

Permalink
Merge pull request #98 from iopred/edit
Browse files Browse the repository at this point in the history
Support GuildMemberEdit api.
  • Loading branch information
bwmarrin committed Jan 27, 2016
2 parents 99351be + 5aab9dc commit 46f893c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,23 @@ func (s *Session) GuildMemberDelete(guildID, userID string) (err error) {
return
}

// GuildMemberEdit edits the roles of a member.
// guildID : The ID of a Guild.
// userID : The ID of a User.
// roles : A list of role ID's to set on the member.
func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err error) {
data := struct {
Roles []string `json:"roles"`
}{roles}

_, err = s.Request("PATCH", GUILD_MEMBER(guildID, userID), data)
if err != nil {
return
}

return
}

// GuildChannels returns an array of Channel structures for all channels of a
// given guild.
// guildID : The ID of a Guild.
Expand Down

0 comments on commit 46f893c

Please sign in to comment.