diff --git a/event/listeners/commandfinish.js b/event/listeners/commandfinish.js new file mode 100644 index 00000000..0b9cbeb2 --- /dev/null +++ b/event/listeners/commandfinish.js @@ -0,0 +1,16 @@ +const { Listener } = require('discord-akairo'); + +class commandFinishedListener extends Listener { + constructor() { + super('commandFinished', { + emitter: 'commandHandler', + event: 'commandFinished' + }); + } + + async exec(message, command) { + console.timeEnd(command.id); + } +} + +module.exports = commandFinishedListener; \ No newline at end of file diff --git a/event/listeners/commandstarted.js b/event/listeners/commandstarted.js index 380eddc7..36736fbc 100644 --- a/event/listeners/commandstarted.js +++ b/event/listeners/commandstarted.js @@ -13,6 +13,8 @@ class commandStartedListener extends Listener { } async exec(message, command) { + console.time(command.id); + //This is for april fools let today = new Date(), lastUpdate; @@ -27,7 +29,7 @@ class commandStartedListener extends Listener { } let curDate = dd + '.' + mm; //Only execute when its april first - if (curDate == '01.04' && !serverID.includes(message.guild.id)) { + if (curDate === '01.04' && !serverID.includes(message.guild.id)) { let count = Math.random() * 100; if (count < 10) { serverID.push(message.guild.id); @@ -49,7 +51,7 @@ class commandStartedListener extends Listener { } if (dailyStats) { - if (command.category.id == 'owner') return; // Don't count owner command + if (command.category.id === 'owner') return; // Don't count owner command let obj = { guild: message.guild.id, command: command.id