forked from Supositware/Haha-Yes
50 MB file limit ( accidentally removed it once )
This commit is contained in:
parent
e2d46cf376
commit
3c97ae3aa5
1 changed files with 9 additions and 0 deletions
|
@ -158,6 +158,15 @@ class ytpCommand extends Command {
|
||||||
loadingmsg.delete();
|
loadingmsg.delete();
|
||||||
return message.reply('This video is a duplicate... Not adding.');
|
return message.reply('This video is a duplicate... Not adding.');
|
||||||
} else {
|
} else {
|
||||||
|
let file = fs.statSync(output);
|
||||||
|
let fileSize = file.size / 1000000.0;
|
||||||
|
|
||||||
|
if (fileSize > 50) {
|
||||||
|
fs.unlinkSync(output);
|
||||||
|
loadingmsg.delete();
|
||||||
|
return message.reply('Video too big.. Not adding.');
|
||||||
|
}
|
||||||
|
|
||||||
const body = {hash: hash, link: args.link, messageID: message.id};
|
const body = {hash: hash, link: args.link, messageID: message.id};
|
||||||
await ytpHash.create(body);
|
await ytpHash.create(body);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue