Please describe the problem you are having in as much detail as possible:
When I move members from 1 channel to another and then log the users from both channels then it still logs the users in the old channel whilst they aren't there anymore. I have tested it with moving between 2 channels in the same category and also moving to other categories.
Include a reproducible code sample here, if possible:
Moving 2 people from channel through .setVoiceChannel (I did it with the use of a loop if that matters)
Further details:
Priority this issue should have – please be realistic and elaborate if possible: No priority at all (imo)
[ ] I found this issue while running code on a __user account__
e576387fea2a973eefe298a6f3610eb0d8b54999Latest commit to master should fix this. (https://github.com/discordjs/discord.js/commit/fbd25f867742bac5511e47bbf69274bdc82ccb23)
The intended behaviour is:
GuildMember#setVoiceChannel is a clone of the original one with the modified voice state. (So the voiceChannel property of it will be the new channel)Somewhat explanation on what went wrong:
GuildMember#edit (also called from GuildMember#setVoiceChannel) edited the original voice state instead of a copy of it for the clone.
This made it impossible for the possibly later coming voice state update to remove the moved member from the old voice channel.
Resulting in a stale GuildMember in the old VoiceChannel's member collection, until the member moves initiated from external sources back in and out.
Most helpful comment
Latest commit to master should fix this. (https://github.com/discordjs/discord.js/commit/fbd25f867742bac5511e47bbf69274bdc82ccb23)
The intended behaviour is:
GuildMember#setVoiceChannelis a clone of the original one with the modified voice state. (So the voiceChannel property of it will be the new channel)Somewhat explanation on what went wrong:
GuildMember#edit(also called fromGuildMember#setVoiceChannel) edited the original voice state instead of a copy of it for the clone.This made it impossible for the possibly later coming voice state update to remove the moved member from the old voice channel.
Resulting in a stale GuildMember in the old VoiceChannel's member collection, until the member moves initiated from external sources back in and out.