From b47ced8dd0f895e3c233d9adb3a81b420cc97825 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 7 Apr 2024 20:19:07 -0400 Subject: [PATCH] Add usage and lastRun Data to slash --- framework/Client.js | 2 ++ framework/slash/SlashCommand.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/framework/Client.js b/framework/Client.js index 1c9302fc..239f58e7 100644 --- a/framework/Client.js +++ b/framework/Client.js @@ -160,6 +160,8 @@ module.exports = class CommandClient extends Client { try { const result = await command.run(interaction); + command.uses++; + command.lastRun = new Date(); this.emit('commandRun', command, result, interaction); } catch (err) { this.emit('commandError', interaction, err); diff --git a/framework/slash/SlashCommand.js b/framework/slash/SlashCommand.js index 16291b20..8aaacf71 100644 --- a/framework/slash/SlashCommand.js +++ b/framework/slash/SlashCommand.js @@ -10,5 +10,7 @@ module.exports = class SlashCommand { url: 'https://github.com/dragonfire535', reason: 'Code' }); + this.uses = 0; + this.lastRun = null; } };