forked from Supositware/Haha-Yes
get the max file size from a guild
This commit is contained in:
parent
1991925213
commit
6a9425eccc
1 changed files with 23 additions and 0 deletions
|
@ -9,6 +9,7 @@ export default {
|
|||
stringIsAValidurl,
|
||||
compressVideo,
|
||||
getVideoCodec,
|
||||
getMaxFileSize,
|
||||
};
|
||||
async function downloadVideo(urlArg, output, format = 'bestvideo*+bestaudio/best') {
|
||||
await new Promise((resolve, reject) => {
|
||||
|
@ -91,3 +92,25 @@ async function getVideoCodec(input) {
|
|||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function getMaxFileSize(guild) {
|
||||
return await new Promise((resolve, reject) => {
|
||||
const tier = guild.premiumTier;
|
||||
console.log(tier);
|
||||
switch (tier) {
|
||||
case 0:
|
||||
case 1:
|
||||
resolve(8);
|
||||
break;
|
||||
case 2:
|
||||
resolve('50');
|
||||
break;
|
||||
case 3:
|
||||
resolve('100');
|
||||
break;
|
||||
default:
|
||||
reject('An error has occured');
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue