only user is shown response for cmd not running
This commit is contained in:
parent
c3490af9d0
commit
a51246ab16
1 changed files with 16 additions and 10 deletions
|
@ -15,15 +15,17 @@ module.exports = class {
|
|||
const command = client.commands.get(interaction.commandName);
|
||||
|
||||
// Return if the command is disabled globally
|
||||
if (command.enabled === false) interaction.reply(
|
||||
client.config.emojis.permError + ' This command has been disabled by my developers.'
|
||||
);
|
||||
if (command.enabled === false) interaction.reply({
|
||||
content: client.config.emojis.permError + ' This command has been disabled by my developers.',
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
// Return if the command is restricted to developers (and the user is not a developer)
|
||||
if (command.devOnly === true && client.config.devIds.includes(interaction.user.id) !== true) {
|
||||
return interaction.reply(
|
||||
`${client.config.emojis.permError} ${interaction.user.username} is not in the sudoers file. This incident will be reported.`
|
||||
);
|
||||
return interaction.reply({
|
||||
content: `${client.config.emojis.permError} ${interaction.user.username} is not in the sudoers file. This incident will be reported.`,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
|
||||
// Cooldown
|
||||
|
@ -32,9 +34,10 @@ module.exports = class {
|
|||
const currentTime = Date.now();
|
||||
const cooldown = command.cooldown / 1000;
|
||||
const timePassed = Math.floor((currentTime - timestamp) / 1000);
|
||||
return interaction.reply(
|
||||
`${client.config.emojis.wait} <@${interaction.user.id}>, you need to wait ${cooldown - timePassed} seconds before using this command again.`
|
||||
);
|
||||
return interaction.reply({
|
||||
content: `${client.config.emojis.wait} You need to wait ${cooldown - timePassed} seconds before using this command again.`,
|
||||
ephemeral: true
|
||||
});
|
||||
} else {
|
||||
client.cooldowns.get(command.name).set(interaction.user.id, new Date());
|
||||
setTimeout(() => {
|
||||
|
@ -48,7 +51,10 @@ module.exports = class {
|
|||
client.logger.command(`Ran ${command.name}`);
|
||||
} catch (error) {
|
||||
client.logger.error('COMMAND_EXECUTION_ERROR', `${command.name}: ${error.stack}`);
|
||||
interaction.reply(`${client.config.emojis.botError} An error occurred when I was trying to run this command. I've sent through the details of the error to my developers.`);
|
||||
interaction.reply({
|
||||
content: `${client.config.emojis.botError} An error occurred when I was trying to run this command. I've sent through the details of the error to my developers.`,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue