Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow kicking user from voice channels with Server.move by passing nil for channel_id #185

Open
gregdan3 opened this issue Oct 12, 2022 · 3 comments

Comments

@gregdan3
Copy link

Discord.js and discordpy both support this feature by passing their equivalent of nil:

discordrb's equivalent, Server.move, evaluates the channel's ID and fails if nil is passed.

Admittedly, I don't immediately see how this is possible via the API, as the modify user voice state endpoint doesn't allow for a null channel id.

https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state

Still, given this is implemented in two other libraries, it must be possible.

@Sobsz
Copy link

Sobsz commented Oct 12, 2022

Confusingly, the relevant request is actually Modify Guild Member, as Modify User Voice State is stated to only work on stage channels. The former's documentation states:

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

@swarley
Copy link
Member

swarley commented Oct 12, 2022

Howdy, you've identified an issue that we've been living with for a while due to some poor design in our API handler that the rest of the library depends on.

Basically, we don't have a way to send a null value to the HTTP API because we compact out null values just before sending the request.

I'm going to look into a workaround to make this sort of thing possible in v3 before we switch to work on v4

@Dakurei
Copy link
Contributor

Dakurei commented Jun 6, 2023

I randomly found this, and in fact it's easily possible since the acceptance of PR #113

It's been a while since the method no longer deletes values at nil, but as it was on the v3.4.2 gem doc, and not the 'main' branch one (as the issue link suggests), it wasn't noticed.

All it takes is one character to solve the problem 🤣
allow_kick_from_voice

I can send a quick PR if needed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants