Skip to content

Commit

Permalink
Added func GuildMemberMove, closes #92
Browse files Browse the repository at this point in the history
  • Loading branch information
bwmarrin committed Feb 18, 2016
1 parent 8180730 commit 22bb771
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ func (s *Session) GuildMemberDelete(guildID, userID string) (err error) {
// 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}
Expand All @@ -477,6 +478,26 @@ func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err e
return
}

// GuildMemberMove moves a guild member from one voice channel to another/none
// guildID : The ID of a Guild.
// userID : The ID of a User.
// channelID : The ID of a channel to move user to, or null?
// NOTE : I am not entirely set on the name of this function and it may change
// prior to the final 1.0.0 release of Discordgo
func (s *Session) GuildMemberMove(guildID, userID, channelID string) (err error) {

data := struct {
ChannelID string `json:"channel_id"`
}{channelID}

_, 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 22bb771

Please sign in to comment.