From 3780fad9ae3fe9c6bb036597d05b4cecc2ad5f54 Mon Sep 17 00:00:00 2001 From: Supositware Date: Tue, 11 Apr 2023 20:16:07 +0200 Subject: [PATCH] await getMaxFIleSize --- commands/fun/audio2image.js | 2 +- commands/fun/image2audio.js | 2 +- commands/utility/vid2gif.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/fun/audio2image.js b/commands/fun/audio2image.js index 6a1a7c98..eed49957 100644 --- a/commands/fun/audio2image.js +++ b/commands/fun/audio2image.js @@ -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`] }); }, diff --git a/commands/fun/image2audio.js b/commands/fun/image2audio.js index ce7638a7..8165cdad 100644 --- a/commands/fun/image2audio.js +++ b/commands/fun/image2audio.js @@ -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`] }); }, diff --git a/commands/utility/vid2gif.js b/commands/utility/vid2gif.js index fb77b4ae..f168e977 100644 --- a/commands/utility/vid2gif.js +++ b/commands/utility/vid2gif.js @@ -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);