I'm pretty new to discord.js but I'm trying to make a bot give roles based on time elapsed since the user joined (the bot's role is above the needed roles and the bot itself has admin permissions)
client.on("guildMemberAdd", (member) => {
member.roles.add(801917861110874122);
});
client.on("message", (message) => {
if(Date.now() - message.member.joinedAt < 1000*60*60*24*1) {
message.member.roles.add(801917434558808074);
}
});
Basically, the bot doesn't give the role neither when the user joins nor when the wanted amount of time passes.