returnmessage.channel.send(`Downloaded by ${message.author.username}`,{files:[`${os.tmpdir()}/${fileName}.mp4`]})
.catch(err=>{
console.error(err);
loadingmsg.delete();
returnmessage.channel.send('File too big');
});
}
//Compress vid if bigger than 8MB
if(fileSize>8){
console.log('file bigger than 8MB');
letcompressmsg=awaitmessage.channel.send('Video bigger than 8MB compressing now <a:loadingmin:527579785212329984> (This can take a long time!)\nWant it to go faster? Donate to the dev with the donate command, so i can get a better server and do it faster!');
loadingmsg.delete();
@ -124,7 +75,6 @@ class DownloadCommand extends Command {
preset:'General/Gmail Small 10 Minutes 288p30'
};
//Compress vid if bigger than 8MB
lethandbrake=hbjs.spawn(options);
handbrake.on('error',err=>{
console.error(err);
@ -148,10 +98,20 @@ class DownloadCommand extends Command {
returnmessage.channel.send('File too big');
});
});
});
}else{
returnmessage.channel.send('You need to input a valid link');
console.log('file smaller than 8MB');
message.delete();
loadingmsg.delete();
returnmessage.channel.send(`Downloaded by ${message.author.username}`,{files:[`${os.tmpdir()}/${fileName}.mp4`]})
.catch(err=>{
console.error(err);
loadingmsg.delete();
returnmessage.channel.send('File too big');
});
}
});
}
returnmessage.channel.send('You need to input a valid link');