Discord.js Ping Pong command with cooldown

I’m very new to coding so it’s probably horrible. Here’s the code

    let userCooldown = {};

client.on("message", message => {
    if (message.content.includes('ping'))
    if (userCooldown[message.author.id]) {
        userCooldown[message.author.id] = false;
        message.reply('Pong');
        setTimeout(() => {
            userCooldown[message.author.id] = true;
        }, 5000) // 5 sec
    }
})

the plan would be for the bot not to respond to the message for 5 seconds until it’s written again