Update GuildMemberMove to support removing from all voice channels (#789)

This commit is contained in:
Dylan Meador 2020-06-28 18:34:50 -04:00 committed by GitHub
parent cab170c8f5
commit 9c46cf4ec7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -844,13 +844,13 @@ func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err e
// 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?
// channelID : The ID of a channel to move user to or nil to remove from voice channel
// 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) {
func (s *Session) GuildMemberMove(guildID string, userID string, channelID *string) (err error) {
data := struct {
ChannelID string `json:"channel_id"`
ChannelID *string `json:"channel_id"`
}{channelID}
_, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, ""))