Added func GuildMemberMove, closes #92

This commit is contained in:
Bruce Marriner 2016-02-18 00:39:53 -06:00
parent 81807304a4
commit 22bb771120

View file

@ -465,6 +465,7 @@ func (s *Session) GuildMemberDelete(guildID, userID string) (err error) {
// userID : The ID of a User. // userID : The ID of a User.
// roles : A list of role ID's to set on the member. // roles : A list of role ID's to set on the member.
func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err error) { func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err error) {
data := struct { data := struct {
Roles []string `json:"roles"` Roles []string `json:"roles"`
}{roles} }{roles}
@ -477,6 +478,26 @@ func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err e
return 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 // GuildChannels returns an array of Channel structures for all channels of a
// given guild. // given guild.
// guildID : The ID of a Guild. // guildID : The ID of a Guild.