fix image detection to not accept ANY mimetype

This commit is contained in:
murm 2023-03-16 20:39:10 -04:00
parent e67c0d96ca
commit 972e1a5bab

View file

@ -142,9 +142,12 @@ const checkImages = async (message, extraReturnTypes, video, sticker) => {
url = url.replace(/.*\n\n/g, "")
if (isValidUrl(url)){
const mimetype = await getType(url, extraReturnTypes)
// console.log(mimetype)
if (mimetype && imageFormats.includes(mimetype)) {
type = {name: "image", path: url, url: url, type: mimetype}
}
}
}
// // first check the embeds
// if (message.embeds.length !== 0) {