shawenguan 1 year ago
parent
commit
68d16ce7ad
1 changed files with 9 additions and 3 deletions
  1. 9 3
      Scripts/168/diiiLotteryRedEnvelop.js

+ 9 - 3
Scripts/168/diiiLotteryRedEnvelop.js

@@ -300,9 +300,15 @@ async function openRoomRedEnvelop(redEnvelopId, isPassCode = 0) {
             magicJS.logger.error(e);
         }
     }).catch(err => {
-        const msg = `请求抢红包发生异常\n${JSON.stringify(err)}`;
-        magicJS.logger.error(msg);
-        return err.response.body;
+        if (err.response && err.response.body) {
+            if (err.response.statusCode == 417) {
+                // 417: 红包已领完
+            }
+            return err.response.body;
+        } else {
+            const msg = `请求抢红包发生异常\n${JSON.stringify(err)}`;
+            magicJS.logger.error(msg);
+        }
     });
     if (!result) {
         return;