force generation option

This commit is contained in:
Supositware 2022-08-31 23:09:46 +02:00
parent a73fd2b893
commit 9765680f1c

View file

@ -9,10 +9,14 @@ const prefixs = prefix.split(',');
export default { export default {
data: new SlashCommandBuilder() data: new SlashCommandBuilder()
.setName('ytp') .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', category: 'fun',
async execute(interaction, arg) { async execute(interaction, args) {
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`); 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 // Read userVid folder and select random vid and only take .mp4
const mp4 = []; const mp4 = [];
@ -46,7 +50,7 @@ export default {
resources: './asset/ytp/resources/', resources: './asset/ytp/resources/',
temp: os.tmpdir(), temp: os.tmpdir(),
sourceList: asset, sourceList: asset,
intro: arg[0] ? './asset/ytp/intro.mp4' : null, intro: args[0] ? './asset/ytp/intro.mp4' : null,
outro: './asset/ytp/outro.mp4', outro: './asset/ytp/outro.mp4',
OUTPUT_FILE: `${os.tmpdir()}/${interaction.id}_YTP.mp4`, OUTPUT_FILE: `${os.tmpdir()}/${interaction.id}_YTP.mp4`,
MAX_CLIPS: MAX_CLIPS, MAX_CLIPS: MAX_CLIPS,