I'm pretty new to Discord.js and Stackoverflow. So I don't know exactly how to do this.
I do know that this question has been asked many times, sadly any I've found haven't worked.
I'm trying to assign roles to members on their birthday. I want to do this with a crontab. Now I have their user ID's but sadly when I request the member with this code.
let guild = client.guilds.cache.get('Guild ID');
let member = guild.members.cache.get('User ID');
console.log(member);
I just get an undefined
message. Now I know that the user ID is correct. I just don't know why I get the undefined
message.
Instead of using:
let guild = client.guilds.cache.get('Guild ID');
let member = guild.members.cache.get('User ID');
I prefer to use something like:
let person = client.members.cache.get('User ID');
console.log(person);
If you still have problems, you will have to enable the Intents on the Discord Developers Portal
Image:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments