Compare commits

..

No commits in common. "fb4db75f0932db309b8db9035ceb60afa07e9219" and "543ab35c9efc86ae284e28d0f5fc3cd8d05fc0ae" have entirely different histories.

3 changed files with 3 additions and 11 deletions

View file

@ -23,7 +23,6 @@ export default {
alias: ['v2g'], alias: ['v2g'],
async execute(interaction, args) { async execute(interaction, args) {
await interaction.deferReply({ ephemeral: false }); await interaction.deferReply({ ephemeral: false });
const maxFileSize = await utils.getMaxFileSize(interaction.guild);
const url = args.url; const url = args.url;
if (!await utils.stringIsAValidurl(url)) { if (!await utils.stringIsAValidurl(url)) {
@ -52,12 +51,12 @@ export default {
await interaction.deleteReply(); await interaction.deleteReply();
await interaction.followUp('❌ Uh oh! The video once converted is too big!', { ephemeral: true }); await interaction.followUp('❌ Uh oh! The video once converted is too big!', { ephemeral: true });
} }
else if (fileSize > maxFileSize) { else if (fileSize > await utils.getMaxFileSize(interaction.guild)) {
const fileURL = await utils.upload(gifsicleOutput) const fileURL = await utils.upload(gifsicleOutput)
.catch(err => { .catch(err => {
console.error(err); console.error(err);
}); });
await interaction.editReply({ content: ` File was bigger than ${maxFileSize} mb. It has been uploaded to an external site.\n${fileURL}`, ephemeral: false }); await interaction.editReply({ content: ` File was bigger than 8 mb. It has been uploaded to an external site.\n${fileURL}`, ephemeral: false });
} }
else { else {
await interaction.editReply({ files: [gifsicleOutput], ephemeral: false }); await interaction.editReply({ files: [gifsicleOutput], ephemeral: false });

View file

@ -16,7 +16,7 @@ You need to install the following
* HandBrakeCLI (For [download](commands/utility/download.js)) * HandBrakeCLI (For [download](commands/utility/download.js))
* gifsicle (For [vid2gif](commands/utility/vid2gif.js)) * gifsicle (For [vid2gif](commands/utility/vid2gif.js))
* gifki (For [vid2gif](commands/utility/vid2gif.js)) * gifki (For [vid2gif](commands/utility/vid2gif.js))
* 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) * 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)
### Installing ### Installing
``` ```

View file

@ -1,6 +1,4 @@
const ratelimit = {}; const ratelimit = {};
const { ownerId } = process.env;
import db from '../models/index.js'; import db from '../models/index.js';
export default { export default {
@ -10,11 +8,6 @@ function check(user, commandName, commands) {
const userID = user.id; const userID = user.id;
const userTag = user.tag; const userTag = user.tag;
// Don't apply the rate limit to bot owner
if (userID === ownerId) {
return false;
}
if (!ratelimit[userID]) { if (!ratelimit[userID]) {
ratelimit[userID] = {}; ratelimit[userID] = {};
} }