#That s what I thought ๐Ÿ˜…

1 messages ยท Page 1 of 1 (latest)

hoary vortex
#

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?

gilded nova
#

Ah no, I'ma try to do that

hoary vortex
#

All good! Lmk when you find something or need more help

#

i haaate slowmode

mint nacelle
#

bro did you even looked at his code? he not returning anywhere

hoary vortex
#

Bro leave

#

You dont want to help, so why even bother

mint nacelle
#

because its basic js and not djs

hoary vortex
#

Leave

mint nacelle
#

and thats the help channel for djs

hoary vortex
#

Bye

mint nacelle
#

look at his code not gona work have fun

gilded nova
hoary vortex
#

Why are there so many toxic fucks here today

#

jesus

mint nacelle
#

he dont return anywhere first so the cooldown doesnt work like that

hoary vortex
mint nacelle
#

then correct me if im wrong im interested

hoary vortex
#

Dont think i said his code was right

mint nacelle
#

i want to learn to where the error is thats why im here

hoary vortex
#

Cool so now i dont see their msgs anymore

#

how is the logging going ๐Ÿ™‚

gilded nova
hoary vortex
#

can you send the code here?

#

cant find in general

gilded nova
#

But even though it's true, there is no cooldown, so the embed can be send again instantly after

gilded nova
#
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)
})```
hoary vortex
#

its not setting the cooldown at all?

#

or does it set it but not save it

#

cus its a local variable

#

try making it global

gilded nova
#

Ok

#

How could I make it to change after the embed is sent then?

hoary vortex
#

wdym?

#

before the embed do if(!cooldown) and after cooldown = true
await sleep(5000)
cooldown = false

#
function sleep(timeInMs) {
    return new Promise(resolve => {
      setTimeout(resolve, timeInMs)
    })
}```
#

and put that code in your file :))