Add NSFW and guildOnly options

This commit is contained in:
Dragon Fire
2024-04-07 20:38:55 -04:00
parent b47ced8dd0
commit 6ce38c282b
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -4,6 +4,8 @@ module.exports = class SlashCommand {
this.name = options.name.toLowerCase();
this.description = options.description;
this.nsfw = options.nsfw || false;
this.guildOnly = options.guildOnly || false;
this.credit = options.credit || [];
this.credit.push({
name: 'Dragon Fire',
+2
View File
@@ -15,6 +15,8 @@ module.exports = class SlashRegistry {
const slashCmd = new SlashCommandBuilder()
.setName(command.name)
.setDescription(command.description);
if (command.guildOnly) slashCmd.setDMPermission(false);
if (command.nsfw) slashCmd.setNSFW(true);
this.commands.set(command.name, { command, data: slashCmd });
return this;
}