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