commit
46f893cf26
1 changed files with 17 additions and 0 deletions
17
restapi.go
17
restapi.go
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue