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!');
returnmessage.channel.send('An error has occured while compressing the video');
});
handbrake.on('progress',progress=>{
console.log(
'Percent complete: %s, ETA: %s',
progress.percentComplete,
progress.eta
);
});
handbrake.on('end',asyncfunction(){
message.delete();
compressmsg.delete();
returnmessage.channel.send(`Downloaded by ${message.author.username}`,{files:[`${os.tmpdir()}/${fileName}compressed.mp4`]})
.catch(err=>{
console.error(err);
compressmsg.delete();
returnmessage.channel.send('File too big');
});
});
}else{
console.log('file smaller than 8MB');
message.delete();
loadingmsg.delete();
returnmessage.channel.send(`Downloaded by ${message.author.username}`,{files:[`${os.tmpdir()}/${fileName}.mp4`]})
@ -114,44 +109,9 @@ class DownloadCommand extends Command {
returnmessage.channel.send('File too big');
});
}
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!');