I've successfully made a ping command, calculating my bot's ping. But I want it to have a delay, about 2 seconds before it sends it result.
Here's my code:
module.exports = {
name: 'ping',
description: "shows the bot/'s ping",
execute(message, args) {
message.channel.send('`ping is being calculated...`').then(msg => {
const ping = msg.createdTimestamp - message.createdTimestamp;
msg.channel.send('`bot\'s` ping: ' + ping + "`ms`")
})
}
}