Im trying to make a discord bot that detects when a specifi user joins a voice chanel but i ran into this error code and dont know what to do about it.
It says that members is undefined, why?
const client = new Discord.Client({ intents: ['Guilds', 'GuildMessages', 'MessageContent'] });
const Guild = client.guilds.cache.get("942493418419028059");
const Member = Guild.members.cache.get("623916311029743617");
if (Member.voice.channel) {
console.log(`${Member.user.tag} is connected to ${Member.voice.channel.name}!`);
} else {
// The member is not connected to a voice channel.
console.log(`${Member.user.tag} is not connected.`);
};