Explorar el Código

Add fail message on invalid image type

denikson hace 6 años
padre
commit
cba811f80b
Se han modificado 1 ficheros con 6 adiciones y 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();