forked from pothtonswer/discordmuffin
Use an array of role ids
This commit is contained in:
parent
b0188cd71e
commit
5aab9dc685
1 changed files with 3 additions and 7 deletions
10
restapi.go
10
restapi.go
|
@ -438,15 +438,11 @@ func (s *Session) GuildMemberDelete(guildID, userID string) (err error) {
|
|||
// GuildMemberEdit edits the roles of a member.
|
||||
// guildID : The ID of a Guild.
|
||||
// userID : The ID of a User.
|
||||
// roles : A list of roles to set on the member.
|
||||
func (s *Session) GuildMemberEdit(guildID, userID string, roles []*Role) (err error) {
|
||||
// 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"`
|
||||
}{[]string{}}
|
||||
|
||||
for _, r := range roles {
|
||||
data.Roles = append(data.Roles, r.ID)
|
||||
}
|
||||
}{roles}
|
||||
|
||||
_, err = s.Request("PATCH", GUILD_MEMBER(guildID, userID), data)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue