Is there a way to make precondition in interaction be ephemeral?

cause with the OwnerOnly the CLI gives it throws the error in a regular reply.
Solution:
Sapphire Framework
Reporting precondition failure | Sapphire
When a precondition fails, it's usually important for the user to know why. For example, if they hit a cooldown or lack
Jump to solution
9 Replies
Favna
Favna10mo ago
yes, just add the property.
./Ticker
./TickerOP10mo ago
where?
Favna
Favna10mo ago
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
./Ticker
./TickerOP10mo ago
yeah, but in the example you guys gave in the CLI there is no interaction reply, you do this.error. Reference:
const { AllFlowsPrecondition } = require('@sapphire/framework');
const { owners } = require('../config.json');

const message = 'This command can only be used by the owner.';
class UserPrecondition extends AllFlowsPrecondition {
/**
* @param {import('discord.js').CommandInteraction} interaction
*/
chatInputRun(interaction) {
return this.doOwnerCheck(interaction.user.id);
}

/**
* @param {import('discord.js').ContextMenuCommandInteraction} interaction
*/
contextMenuRun(interaction) {
return this.doOwnerCheck(interaction.user.id);
}

/**
* @param {import('discord.js').Message} message
*/
messageRun(message) {
return this.doOwnerCheck(message.author.id);
}

/**
* @param {import('discord.js').Snowflake} userId
*/
doOwnerCheck(userId) {
return owners.includes(userId) ? this.ok() : this.error({ message });
}
}

module.exports = {
UserPrecondition
};
const { AllFlowsPrecondition } = require('@sapphire/framework');
const { owners } = require('../config.json');

const message = 'This command can only be used by the owner.';
class UserPrecondition extends AllFlowsPrecondition {
/**
* @param {import('discord.js').CommandInteraction} interaction
*/
chatInputRun(interaction) {
return this.doOwnerCheck(interaction.user.id);
}

/**
* @param {import('discord.js').ContextMenuCommandInteraction} interaction
*/
contextMenuRun(interaction) {
return this.doOwnerCheck(interaction.user.id);
}

/**
* @param {import('discord.js').Message} message
*/
messageRun(message) {
return this.doOwnerCheck(message.author.id);
}

/**
* @param {import('discord.js').Snowflake} userId
*/
doOwnerCheck(userId) {
return owners.includes(userId) ? this.ok() : this.error({ message });
}
}

module.exports = {
UserPrecondition
};
Favna
Favna10mo ago
oh thats what you meant
Solution
Favna
Favna10mo ago
Sapphire Framework
Reporting precondition failure | Sapphire
When a precondition fails, it's usually important for the user to know why. For example, if they hit a cooldown or lack
./Ticker
./TickerOP10mo ago
yeah lmao lemme check that one sec oh so we do a listener for that?
Favna
Favna10mo ago
yes
./Ticker
./TickerOP10mo ago
Gotchu, thanks!
Want results from more Discord servers?
Add your server