Skip to main content

Locking commands to NSFW channels

Sometimes it can be necessary to lock certain commands to NSFW (not safe for work) channels. This can be simply achieved by setting the nsfw option in the command.

const { Command } = require('@sapphire/framework');

class NSFWCommand extends Command {
constructor(context) {
super(context, {
// ...
nsfw: true
});
}
}
module.exports = {
NSFWCommand
};
tip

To learn how to send a message to the command executor when a precondition fails, see Reporting Precondition Failure.