I am making a crude bot (since I am new at java script), and was wondering if "user.voiceChannel" still existed. When I looked through the structure I did not see it, but I saw it was added a while back. I am just wanting the bot to see if the author of a command message is in a voice channel so that it can join the channel, play a short audio file that is about 3 seconds long, and leave the channel at the end of the audio file.
Any help is much appreciated!
There might be an easier way to do this, but I started from the client, found the Guild, and then the appropriate GuildMember which has the voiceChannel property that you're looking for.
client.guilds.find('id', msg.guild.id).members.find('id', msg.author.id).voiceChannel
Message.member and GuildMember.voiceChannel are what you want.
And please, _please_ do not use Collection.find for IDs. Just use Collection.get. Collections extend Map.
Most helpful comment
Message.memberandGuildMember.voiceChannelare what you want.And please, _please_ do not use
Collection.findfor IDs. Just useCollection.get. Collections extend Map.