andersfylling / disgord

Go module for interacting with the documented Discord's bot interface; Gateway, REST requests and voice
BSD 3-Clause "New" or "Revised" License
496 stars 70 forks source link

No way to disconnect member from channel #446

Closed ImVexed closed 2 years ago

ImVexed commented 2 years ago

Describe the bug UpdateGuildMemberBuilder rejects a channel ID of 0.

Expected behavior Some way of passing a null value to SetChannelID to signify that the member should be disconnected (https://discord.com/developers/docs/resources/guild#modify-guild-member)

If the channel_id is set to null, this will force the target user to be disconnected from voice.

Desktop (please complete the following information): -Golang version: 1.17.1 -Using Go modules? yes -Disgord version? v0.29.0 -Connected to the gateway before using REST methods? yes

andersfylling commented 2 years ago

The API seems to be a bit messy regarding voice.

Does client.Guild(..).KickVoiceParticipant(..) work for you?

ImVexed commented 2 years ago

I think DisconnectVoiceParticipant would probably make the most sense, discord seems to only use Kick to refer to removing a member from a guild.

Either way, anything works fine!

andersfylling commented 2 years ago

Oh, fair. I guess the Kick prefix can be a bit scary.