소스 검색

Add fail message on invalid image type

denikson 6 년 전
부모
커밋
cba811f80b
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      commands/facemorph.js

+ 6 - 1
commands/facemorph.js

@@ -146,8 +146,13 @@ const onDirectMention = (msg, content, actionsDone) => {
         return false;
         return false;
 
 
     let image = msg.attachments.find(v => util.isValidImage(v.filename));
     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;
         return false;
+    }
 
 
     let todayQuota = db.get("faceEditInfo.todayRequests").value();
     let todayQuota = db.get("faceEditInfo.todayRequests").value();
     let maxQuota = db.get("faceEditInfo.customRequestsPerDay").value();
     let maxQuota = db.get("faceEditInfo.customRequestsPerDay").value();