From 9765680f1c16c12329b6cabd43c3266af0f29dff Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 31 Aug 2022 23:09:46 +0200 Subject: [PATCH] force generation option --- commands/fun/ytp.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/fun/ytp.js b/commands/fun/ytp.js index c6bcec50..1530c085 100644 --- a/commands/fun/ytp.js +++ b/commands/fun/ytp.js @@ -9,10 +9,14 @@ const prefixs = prefix.split(','); export default { data: new SlashCommandBuilder() .setName('ytp') - .setDescription('Generate a YTP'), + .setDescription('Generate a YTP') + .addBooleanOption(option => + option.setName('force') + .setDescription('Force the generation of the video in non-nsfw channel.') + .setRequired(false)), category: 'fun', - async execute(interaction, arg) { - if (!interaction.channel.nsfw && !arg[0]) return interaction.reply(`Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry ) OR do \`\`${prefixs[0]}ytp --force\`\` to make the command work outside of nsfw channel BE AWARE THAT IT WON'T CHANGE THE FINAL RESULT SO NSFW CAN STILL HAPPEN`); + async execute(interaction, args) { + if (!interaction.channel.nsfw && !args[0]) return interaction.reply(`Please execute this command in an NSFW channel ( Content might not be NSFW but since the video are user submitted better safe than sorry ) OR do \`\`${prefixs[0]}ytp --force\`\` to make the command work outside of nsfw channel BE AWARE THAT IT WON'T CHANGE THE FINAL RESULT SO NSFW CAN STILL HAPPEN`); // Read userVid folder and select random vid and only take .mp4 const mp4 = []; @@ -46,7 +50,7 @@ export default { resources: './asset/ytp/resources/', temp: os.tmpdir(), sourceList: asset, - intro: arg[0] ? './asset/ytp/intro.mp4' : null, + intro: args[0] ? './asset/ytp/intro.mp4' : null, outro: './asset/ytp/outro.mp4', OUTPUT_FILE: `${os.tmpdir()}/${interaction.id}_YTP.mp4`, MAX_CLIPS: MAX_CLIPS,