Add execution time to command logging

This commit is contained in:
SileNce5k 2021-08-03 16:25:17 +02:00
parent c2e88c9948
commit af4c08b220
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -37,8 +37,10 @@ module.exports = function(client, owners, message, globalPrefix){
}
if (command.admin && owners.indexOf(message.author.id.toString()) == -1) return;
try {
let t0 = performance.now();
command.execute({ message: message, args: args, client: client, prefix: prefix, owners: owners, globalPrefix: globalPrefix})
console.log(`${message.author.username}(id: ${message.author.id}) executed ${command.name} with '${args}' as arguments`)
let t1 = performance.now();
console.log(`${message.author.username}(id: ${message.author.id}) executed ${command.name} with '${args}' as arguments in ${(t1-t0).toFixed(2)} ms`)
} catch (error) {
let divider = "------------------------"
console.log(divider)