|
@@ -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.
|