forked from Supositware/Haha-Yes
await getMaxFIleSize
This commit is contained in:
parent
d4e3693be6
commit
3780fad9ae
3 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ export default {
|
|||
const file = fs.statSync(`${os.tmpdir()}/${args.audio.name}.png`);
|
||||
const fileSize = (file.size / 1000000.0).toFixed(2);
|
||||
|
||||
if (fileSize > utils.getMaxFileSize(interaction.guild)) return interaction.editReply('error');
|
||||
if (fileSize > await utils.getMaxFileSize(interaction.guild)) return interaction.editReply('error');
|
||||
interaction.editReply({ content: `Image file is ${fileSize} MB` });
|
||||
return interaction.followUp({ files: [`${os.tmpdir()}/${args.audio.name}.png`] });
|
||||
},
|
||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
|||
const file = fs.statSync(`${os.tmpdir()}/${args.img.name}.mp3`);
|
||||
const fileSize = (file.size / 1000000.0).toFixed(2);
|
||||
|
||||
if (fileSize > utils.getMaxFileSize(interaction.guild)) return interaction.editReply('error');
|
||||
if (fileSize > await utils.getMaxFileSize(interaction.guild)) return interaction.editReply('error');
|
||||
interaction.editReply({ content: `Audio file is ${fileSize} MB` });
|
||||
return interaction.followUp({ files: [`${os.tmpdir()}/${args.img.name}.mp3`] });
|
||||
},
|
||||
|
|
|
@ -46,7 +46,7 @@ export default {
|
|||
await interaction.deleteReply();
|
||||
await interaction.followUp('❌ Uh oh! The video once converted is too big!', { ephemeral: true });
|
||||
}
|
||||
else if (fileSize > utils.getMaxFileSize(interaction.guild)) {
|
||||
else if (fileSize > await utils.getMaxFileSize(interaction.guild)) {
|
||||
const fileURL = await utils.upload(gifsicleOutput)
|
||||
.catch(err => {
|
||||
console.error(err);
|
||||
|
|
Loading…
Reference in a new issue