mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add usage and lastRun Data to slash
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user