diff --git a/src/commands/fun/gelbooru.js b/src/commands/fun/gelbooru.js index 73684a0..467aa72 100644 --- a/src/commands/fun/gelbooru.js +++ b/src/commands/fun/gelbooru.js @@ -28,6 +28,12 @@ const data = new SlashCommandBuilder() .setDescription("Booru board to search (default: gelbooru)") .addChoices(boorus) ) + .addBooleanOption(builder => + builder // + .setName("nsfw") + .setRequired(false) + .setDescription("Allow NSFW posts") + ) .setContexts([ InteractionContextType.Guild, InteractionContextType.BotDM, @@ -93,6 +99,7 @@ module.exports = { async execute(interaction) { const tags = interaction.options.getString("tags").split(" "); const booru = interaction.options.getString("booru") ?? defaultBooru; + const nsfw = interaction.options.getBoolean("nsfw") ?? false; await interaction.deferReply(); console.log(booru, tags); @@ -106,7 +113,7 @@ module.exports = { await interaction.followUp("Could not find any post matching tags."); return; } - if (isNSFWPost(newPost)) continue; + if (!nsfw && isNSFWPost(newPost)) continue; post = newPost; }