Remove the message and spoiler if executed in a nsfw channel

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-09-07 17:28:42 +02:00
parent 9a217cc139
commit eb28545cbd

View file

@ -24,7 +24,7 @@ class PetitTubeCommand extends Command {
const url = $('iframe')[0].attribs.src; const url = $('iframe')[0].attribs.src;
this.client.commandHandler.runCommand(message, this.client.commandHandler.findCommand('download'), { link: new URL(url), proxy: 1, spoiler: true, caption: 'Video might be NSFW as always, be careful!'}); this.client.commandHandler.runCommand(message, this.client.commandHandler.findCommand('download'), { link: new URL(url), proxy: 1, spoiler: !message.channel.nsfw, caption: message.channel.nsfw ? '' : 'Video might be NSFW as always, be careful!'});
} }
} }
module.exports = PetitTubeCommand; module.exports = PetitTubeCommand;