Explorar o código

Add fail message on invalid image type

denikson %!s(int64=6) %!d(string=hai) anos
pai
achega
cba811f80b
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      commands/facemorph.js

+ 6 - 1
commands/facemorph.js

@@ -146,8 +146,13 @@ const onDirectMention = (msg, content, actionsDone) => {
         return false;
 
     let image = msg.attachments.find(v => util.isValidImage(v.filename));
-    if (!image)
+    if (!image){
+        if(msg.attachments.size > 0) {
+            msg.channel.send(`${msg.author.toString()} Nice, but I can't do anything to it! (Invalid file type)`);
+            return true;
+        }
         return false;
+    }
 
     let todayQuota = db.get("faceEditInfo.todayRequests").value();
     let maxQuota = db.get("faceEditInfo.customRequestsPerDay").value();