2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00

修正签到推送无法发送对应好友问题

This commit is contained in:
Ctrlcvs 2022-08-10 20:15:49 +08:00 committed by leiyilu
parent 3abb3c158b
commit 30a7d36e20
3 changed files with 6 additions and 13 deletions

View File

@ -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云原神自动签到成功");
}
};

View File

@ -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
}

View File

@ -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)
})
}
}