From 1aa341e0f1effc56a1e9924bb0673955240e3ed5 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sun, 29 Mar 2020 03:53:06 +0200 Subject: [PATCH] fix output 2 --- commands/fun/ytp.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/commands/fun/ytp.js b/commands/fun/ytp.js index 793acbbf..3caf4b22 100644 --- a/commands/fun/ytp.js +++ b/commands/fun/ytp.js @@ -125,14 +125,17 @@ class ytpCommand extends Command { if (url) { return youtubedl.exec(url, ['--max-filesize', '50m', '--format=mp4', '-o', `./asset/ytp/userVid/${message.id}.mp4`], {}, function(err, output) { + console.log(output); if (err) { console.error(err); loadingmsg.delete(); return message.channel.send('An error has occured, I can\'t download from the link you provided. Is it an mp4?'); } else { - if (output[2].includes('File is larger than max-filesize')) { - loadingmsg.delete(); - return message.channel.send(output[2]); + if (output[2]) { + if (output[2].includes('File is larger than max-filesize')) { + loadingmsg.delete(); + return message.channel.send(output[2]); + } } let mp4 = [];