On occasion a guild will no longer populate Member#voiceChannel
When this occurs all Members new and existing will forever until bot/shard reboot return undefined for
Member#voiceChannel Neither connecting / disconnecting to the voice channel nor new members joining will affect it.
I believe there to be some caching issue specifically with the voiceChannel property of the guildMember object.
As a separate issue I have noticed cases where the bot member obj (me) will return undefined for me.voiceChannel but message.guild.voiceconnection.channel will return the channel the bot is in.
Some tests during the primary issue revealed that !eval message.guild.channels.filter(chn => chn.type === "voice") returns all the guilds voiceChannels, so the bot can see them
the message.member object appeared to be a valid guild member object with just voiceChannel and voiceChannelID returning undefined
Update:
An update on this issue. When this happens Member#voiceState including voiceState.channel_id is still being updated properly. Its just not properly fetching the data for the voiceChannelId and voiceChannel properties
Update2:
An update on this issue. So apparently voiceState is not always working when this issue is happening. The most recent occurrence of this, featured no voiceStates for anyone.
Further details:
Operating system: Win 10, Server 2012, Server 2016, Ubuntu Server 16.x
Priority this issue should have – please be realistic and elaborate if possible: Medium
Maybe the bot can't see the voice channel?
Try to leave the voice channel, then reboot the bot, then join again.
@NoahLiedFilmCodes Rebooting to bot does fix it but thats never a good solution / fix for any problem.
As i stated above - leaving/rejoining of the voiceChannel does not change anything.
"latest master" is useless please specify a hash
@devsnek Sorry - I updated the main post with more exact and detailed information
An update on this issue. When this happens Member#voiceState including voiceState.channel_id is still being updated properly. Its just not properly fetching the data for the voiceChannelId and voiceChannel properties
Apparently I was wrong, voiceStates are undefined in "some" cases when this happens
I am having an issue that may be related: as of 97823bc (latest master, commit from a day ago as of this writing) on the client event voiceStateUpdate, both the oldMember and newMember member objects it returns seem to lack voiceChannel and voiceChannelID properties 100% of the time. If this is unrelated, I can open a new issue.
Reproducible Steps: (for clientuser member obj)
1: Make request to play audio. (should play correctly)
3: kick the bot
4: Reinvite bot
5: attempt to play audio. (once connection is established, and audio is playing eval message.guild.me.voiceChannel) will return undefined.
Most helpful comment
"latest master" is useless please specify a hash