#That s what I thought ๐
1 messages ยท Page 1 of 1 (latest)
T
Here we go, no ppl here
have you tried console logging parts of the event as you want it to run?
to see where it messes?
Ah no, I'ma try to do that
bro did you even looked at his code? he not returning anywhere
because its basic js and not djs
Leave
and thats the help channel for djs
Bye
look at his code not gona work have fun
Then just tell what won't work 
its not toxic i want to help him but you dont looked at his code
he dont return anywhere first so the cooldown doesnt work like that

then correct me if im wrong im interested
Dont think i said his code was right
i want to learn to where the error is thats why im here
I think the timeout doesn't work, cooldown stays true
But even though it's true, there is no cooldown, so the embed can be send again instantly after
Sure
client.on('guildMemberAdd', member => {
var cooldown = false;
if (cooldown !== true);
console.log(cooldown)
let now = Date.now();
let createdAt = member.user.createdTimestamp;
let age = now - createdAt;
let actualAge = pm(age, {verbose: true})
let welcome_embed = new MessageEmbed()
.setTitle('Welcome!')
.setDescription(`${member} has just joined the server! \nTheir account is ${actualAge} old.`)
.setImage('https://media.discordapp.net/attachments/980210726989885492/981599107644813383/unknown.png?width=604&height=401')
client.channels.cache.get('967457003968557136').send({content: `${member} has just joined the server!`, embeds: [welcome_embed]});
var cooldown = true;
console.log(cooldown)
setTimeout(function(){ var cooldown = false }, 5000);
console.log(cooldown)
})```