Increase file size limit to 25MB

This commit is contained in:
Dragon Fire
2024-05-06 00:49:49 -04:00
parent fcb5896b01
commit 9460771b32
60 changed files with 63 additions and 63 deletions
+4 -4
View File
@@ -11,17 +11,17 @@ module.exports = class ImageArgument extends Argument {
async validate(value, msg) {
const attachment = msg.attachments.first();
if (attachment) {
if (attachment.size > 8e+6) return false;
if (!fileTypeRe.test(attachment.name)) return false;
if (attachment.size > 8e+6) return 'Image size is above 8 MB.';
if (!fileTypeRe.test(attachment.name)) return 'Provided attachment is not an image.';
return true;
}
if (fileTypeRe.test(value.toLowerCase())) {
if (!validURL.isWebUri(value)) return false;
if (!validURL.isWebUri(value)) return 'Provided URL is not valid.';
try {
await request.get(value);
return true;
} catch {
return false;
return 'Provided URL is not valid.';
}
}
return false;