Add usage and lastRun Data to slash

This commit is contained in:
Dragon Fire
2024-04-07 20:19:07 -04:00
parent ab61794d7c
commit b47ced8dd0
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -160,6 +160,8 @@ module.exports = class CommandClient extends Client {
try { try {
const result = await command.run(interaction); const result = await command.run(interaction);
command.uses++;
command.lastRun = new Date();
this.emit('commandRun', command, result, interaction); this.emit('commandRun', command, result, interaction);
} catch (err) { } catch (err) {
this.emit('commandError', interaction, err); this.emit('commandError', interaction, err);
+2
View File
@@ -10,5 +10,7 @@ module.exports = class SlashCommand {
url: 'https://github.com/dragonfire535', url: 'https://github.com/dragonfire535',
reason: 'Code' reason: 'Code'
}); });
this.uses = 0;
this.lastRun = null;
} }
}; };