I was trying code for ping and I end up like this.. new to coding any help will greatly be appreciated...
Here is the code:
module.exports = {
name: 'ping' ,
description: "this is a ping command.",
execute(message, arguments, client) {
message.reply('Calculating ping...').then((resultmessage) => {
const ping = resultmessage.createdtimestamp - message.createdtimestamp
resultmessage.edit(`Bot latency: ${ping}`)
})
}
}
am using command handler .. main code is.
if(command === 'ping'){
client.commands.get('ping').execute(message, args,client);
and here whats the output and its bad... Bot latency: NaN