From 30a7d36e200570d7a5d63879ba489f586c68a7ef Mon Sep 17 00:00:00 2001 From: Ctrlcvs <1509167646@qq.com> Date: Wed, 10 Aug 2022 20:15:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=AD=BE=E5=88=B0=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E6=97=A0=E6=B3=95=E5=8F=91=E9=80=81=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sign.js | 13 +++---------- model/mys/mihoyo-api.js | 2 +- model/mys/utils.js | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/apps/sign.js b/apps/sign.js index 2efb585..8ac1af2 100644 --- a/apps/sign.js +++ b/apps/sign.js @@ -309,12 +309,11 @@ export async function allMysSign() { if (!isPushSign||ismysbool) { return; } - if (msg.includes("签到成功") && (cookie.isSignPush === true || cookie.isSignPush === undefined)) { + if (msg.includes("OK")) { //签到成功并且不是已签到的才推送 // msg = msg.replace("签到成功", "自动签到成功"); utils.relpyPrivate(user_id, msg + "\n自动签到成功"); } }; - await mysSign(e); await utils.sleepAsync(10000); } @@ -346,13 +345,10 @@ export async function allSign() { e.msg = "全部" Bot.logger.mark(`正在为qq${user_id}米社签到中...`); e.reply = (msg) => { - if (!msg.includes("OK")) { - return; - } if (!isAllSign||isbool) { return; } - if (msg.includes("签到成功") && (cookie.isSignPush === true || cookie.isSignPush === undefined)) { + if (msg.includes("OK")) { utils.relpyPrivate(qq, msg + "\n自动签到成功"); } }; @@ -432,13 +428,10 @@ export async function yunSignlist(e){ Bot.logger.mark(`正在为qq${user_id}云原神签到中...`); e.msg = "全部" e.reply = (msg) => { - if (!msg.includes("OK")) { - return; - } if (!isYunSignMsg||isYun) { return; } - if (msg.includes("签到成功")) { + if (msg.includes("领取奖励")) { utils.relpyPrivate(qq, msg + "\n云原神自动签到成功"); } }; diff --git a/model/mys/mihoyo-api.js b/model/mys/mihoyo-api.js index de70b3c..f237ce1 100644 --- a/model/mys/mihoyo-api.js +++ b/model/mys/mihoyo-api.js @@ -238,7 +238,7 @@ export default class MihoYoApi { let reward_msg = item.msg; url = `https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/ackNotification?id=${reward_id}`; res = await superagent.post(url).set(this.getyunHeader()).timeout(10000); - let log_msg=`\n领取奖励,ID:${reward_id},Msg:${reward_msg}`; + let log_msg=`\n领取奖励,ID:${reward_id},Msg:${reward_msg.msg}`; Bot.logger.info(log_msg) sendMSg+=log_msg } diff --git a/model/mys/utils.js b/model/mys/utils.js index 5470b56..a1eccd6 100644 --- a/model/mys/utils.js +++ b/model/mys/utils.js @@ -31,9 +31,9 @@ export async function relpyPrivate (userId, msg) { userId = Number(userId) let friend = Bot.fl.get(userId) if (friend) { - logger.mark(`发送好友消息[${friend.nickname}](${userId})`) + Bot.logger.mark(`发送好友消息[${friend.nickname}](${userId})`) return await Bot.pickUser(userId).sendMsg(msg).catch((err) => { - logger.mark(err) + Bot.logger.mark(err) }) } }