Allow bmp and jfif images

This commit is contained in:
Dragon Fire
2020-06-15 16:05:01 -04:00
parent 032271e538
commit 8e9f7a49f9
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
const { ArgumentType } = require('discord.js-commando');
const fileTypeRe = /\.(jpe?g|png|gif)$/i;
const fileTypeRe = /\.(jpe?g|png|gif|jfif|bmp)$/i;
const request = require('node-superfetch');
module.exports = class ImageArgumentType extends ArgumentType {
@@ -12,7 +12,7 @@ module.exports = class ImageArgumentType extends ArgumentType {
if (attachment) {
if (!attachment.height || !attachment.width) return false;
if (attachment.size > 8e+6) return 'Please provide an image under 8 MB.';
if (!fileTypeRe.test(attachment.name)) return 'Please only send PNG, JPG, or GIF format images.';
if (!fileTypeRe.test(attachment.name)) return 'Please only send PNG, JPG, BMP, or GIF format images.';
return true;
}
if (fileTypeRe.test(value.toLowerCase())) {