Closed FsxShader2012 closed 4 years ago
Because bot, which a client
object, does not have a members
property. Even the docs don't mention that it should have. You can get the members
property on a server
object though.
You can use something like this to get the members
of a server
from a channel ID:
const serverID = bot.channels[channelID].guild_id;
const server = bot.servers[serverID];
// Now you can use members on server to get voice_channel_id
const userVoiceChannelID = server.members[userID].voice_channel_id;
Sorry, I'm completely new to OOP. Appreciate the help, works perfectly!
If you have more questions, please join the server! https://discord.gg/0MvHMfHcTKVVmIGP
bot.members[userID].voice_channel_id
results in the following outputTypeError: Cannot read property '18647709XXXXXXX' of undefined
(X'ed my UserID for privacy reasons) Same result for every property of theMember
object.bot.users[userID].id
works fine.