瀏覽代碼

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;
 
     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();