Compare commits
2 commits
e67c0d96ca
...
c11fa40dfc
Author | SHA1 | Date | |
---|---|---|---|
|
c11fa40dfc | ||
|
972e1a5bab |
2 changed files with 5 additions and 2 deletions
|
@ -40,7 +40,7 @@ class ImageCommand extends Command {
|
||||||
if (selection) selectedImages.delete(this.author);
|
if (selection) selectedImages.delete(this.author);
|
||||||
if (image === undefined) {
|
if (image === undefined) {
|
||||||
runningCommands.delete(this.author);
|
runningCommands.delete(this.author);
|
||||||
return `${this.constructor.noImage} (Tip: try right-clicking/holding on a message and press Apps -> Select Image, then try again.)`;
|
return `${this.constructor.noImage} (Tip: try running your command while replying to an image (or link to an image))`;
|
||||||
} else if (image.type === "large") {
|
} else if (image.type === "large") {
|
||||||
runningCommands.delete(this.author);
|
runningCommands.delete(this.author);
|
||||||
return "That image is too large (>= 25MB)! Try using a smaller image.";
|
return "That image is too large (>= 25MB)! Try using a smaller image.";
|
||||||
|
|
|
@ -142,7 +142,10 @@ const checkImages = async (message, extraReturnTypes, video, sticker) => {
|
||||||
url = url.replace(/.*\n\n/g, "")
|
url = url.replace(/.*\n\n/g, "")
|
||||||
if (isValidUrl(url)){
|
if (isValidUrl(url)){
|
||||||
const mimetype = await getType(url, extraReturnTypes)
|
const mimetype = await getType(url, extraReturnTypes)
|
||||||
type = {name: "image", path: url, url: url, type: mimetype}
|
// console.log(mimetype)
|
||||||
|
if (mimetype && imageFormats.includes(mimetype)) {
|
||||||
|
type = {name: "image", path: url, url: url, type: mimetype}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue