mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Allow bmp and jfif images
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "116.29.0",
|
"version": "116.29.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
const { ArgumentType } = require('discord.js-commando');
|
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');
|
const request = require('node-superfetch');
|
||||||
|
|
||||||
module.exports = class ImageArgumentType extends ArgumentType {
|
module.exports = class ImageArgumentType extends ArgumentType {
|
||||||
@@ -12,7 +12,7 @@ module.exports = class ImageArgumentType extends ArgumentType {
|
|||||||
if (attachment) {
|
if (attachment) {
|
||||||
if (!attachment.height || !attachment.width) return false;
|
if (!attachment.height || !attachment.width) return false;
|
||||||
if (attachment.size > 8e+6) return 'Please provide an image under 8 MB.';
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
if (fileTypeRe.test(value.toLowerCase())) {
|
if (fileTypeRe.test(value.toLowerCase())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user