discord-jda / JDA

Java wrapper for the popular chat & VOIP service: Discord https://discord.com
Apache License 2.0
4.35k stars 735 forks source link

Changing Member's Audio Channel Connection #1380

Closed JRedOW closed 4 years ago

JRedOW commented 4 years ago

General Troubleshooting

Feature Request

The ability to move members who are in a voice channel to another channel. This currently exists in discord.py as move_to().

Example Use-Case

This can be used in many cases. For example, a bot that finds matches for members and puts them in private discord calls as teams. Or you can access a member's current game (also supported by discord.py, but that should be another issue) and move them to a call with players playing the same game. Or a bot that runs a fake courtroom, allowing certain members to sit in a "waiting room" and have the bot connect them one by one. The possibilities are endless.

I may make a pull request with this feature myself, as it seems simple to integrate after reading over discord.py's code since JDA already support muting, deafening, etc. which are very similar.

Andre601 commented 4 years ago

This method already exists as Guild#moveVoiceMember(Member, VoiceChannel)

Next time, please check the Javadocs or ask in the Discord Server before opening an issue. Thanks

JRedOW commented 4 years ago

This method already exists as Guild#moveVoiceMember(Member, VoiceChannel)

Next time, please check the Javadocs or ask in the Discord Server before opening an issue. Thanks

Wow. I thought looked everywhere, but I must not have checked the Guild class. I thought it would be under Member or Voice Channel.

Andre601 commented 4 years ago

Pretty much all actions that can be performed by any member with sufficient permissions can be found in the Guild Object, as the Member Object is pretty much only a representation of the actual Guild Member containing info such as (nick)name, id, etc. and a VoiceChannel only contains actions and methods for that channel alone, such as renaming it... Moving a member isn't either, as you don't really alter the member or VoiceChannel other than changing their connection and member count respectively.

And considering that there can be several Member and VoiceChannel instances but only one Guild instance per Guild would it also not make much sense to have such a method for either the Member or VC... Like when your Bot (which is also just a member) would move someone, would you now call the method on the bot, the member, the channel they got moved from or the channel they got moved to? It would become way more complicated than it has to be...

At least that's my laymen's description of how I understand the limitations and such behind this... If a maintainer (Minn) has more detailed info, feel free to correct me on this.