From 59bf0b94309f602df8dac137bada084245afd935 Mon Sep 17 00:00:00 2001 From: Supositware Date: Wed, 19 Apr 2023 17:05:35 +0200 Subject: [PATCH] Update file size limit --- commands/utility/vid2gif.js | 5 +++-- readme.md | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/commands/utility/vid2gif.js b/commands/utility/vid2gif.js index 8a12fad5..62e4b22d 100644 --- a/commands/utility/vid2gif.js +++ b/commands/utility/vid2gif.js @@ -23,6 +23,7 @@ export default { alias: ['v2g'], async execute(interaction, args) { await interaction.deferReply({ ephemeral: false }); + const maxFileSize = await utils.getMaxFileSize(interaction.guild); const url = args.url; if (!await utils.stringIsAValidurl(url)) { @@ -51,12 +52,12 @@ export default { await interaction.deleteReply(); await interaction.followUp('❌ Uh oh! The video once converted is too big!', { ephemeral: true }); } - else if (fileSize > await utils.getMaxFileSize(interaction.guild)) { + else if (fileSize > maxFileSize) { const fileURL = await utils.upload(gifsicleOutput) .catch(err => { console.error(err); }); - await interaction.editReply({ content: `ℹ️ File was bigger than 8 mb. It has been uploaded to an external site.\n${fileURL}`, ephemeral: false }); + await interaction.editReply({ content: `ℹ️ File was bigger than ${maxFileSize} mb. It has been uploaded to an external site.\n${fileURL}`, ephemeral: false }); } else { await interaction.editReply({ files: [gifsicleOutput], ephemeral: false }); diff --git a/readme.md b/readme.md index 8d803e0b..f3b80982 100644 --- a/readme.md +++ b/readme.md @@ -16,7 +16,7 @@ You need to install the following * HandBrakeCLI (For [download](commands/utility/download.js)) * gifsicle (For [vid2gif](commands/utility/vid2gif.js)) * gifki (For [vid2gif](commands/utility/vid2gif.js)) -* Somewhere to upload files larger than 8 mb (I use a self hosted [XBackBone](https://github.com/SergiX44/XBackBone/) with the upload.sh script made from it, you can use anything else just need to be located in bin/upload.sh) +* Somewhere to upload files larger than the file limit, currently 25 mb. (I use a self hosted [XBackBone](https://github.com/SergiX44/XBackBone/) with the upload.sh script made from it, you can use anything else just need to be located in bin/upload.sh) ### Installing ```