From 419dc18d8f569e23f847dcbb25a6571f39218c68 Mon Sep 17 00:00:00 2001 From: FanSky_Qs <3141865879@qq.com> Date: Thu, 6 Jul 2023 09:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E6=8A=BD=E5=8D=A1=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E8=8E=B7=E5=8F=96=E5=88=B7=E5=B1=8F-=E8=BD=AC?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=B0=81=E8=A3=85=20(#196)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/model/gachaLog.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/model/gachaLog.js b/plugins/genshin/model/gachaLog.js index 0757584..443126c 100644 --- a/plugins/genshin/model/gachaLog.js +++ b/plugins/genshin/model/gachaLog.js @@ -46,16 +46,30 @@ export default class GachaLog extends base { this.e.reply('链接发送成功,数据获取中... 请耐心等待') + /**制作合并消息 */ + let MakeMsg=[] + let tmpMsg='' /** 按卡池更新记录 */ for (let i in this.pool) { this.type = this.pool[i].type this.typeName = this.pool[i].typeName let res = await this.updateLog() - if (res) await this.e.reply(`${this.typeName}记录获取成功,更新${res.num}条`) + if(res){ + tmpMsg+=`[${this.typeName}]记录获取成功,更新${res.num}条\n` + } if (i <= 1) await common.sleep(500) } + //只去掉结尾的多余一个换行符 + tmpMsg=tmpMsg.replace(/(\n)$/, '') + MakeMsg.push(tmpMsg) + MakeMsg.push(`抽卡记录更新完成,您还可回复\n【#${this?.e?.isSr?'星铁光锥':'武器'}记录】统计${this?.e?.isSr?'星铁光锥':'武器'}池数据\n【#${this?.e?.isSr?'星铁':''}角色统计】按卡池统计数据\n【#导出记录】导出记录数据`) + let Msg = await common.makeForwardMsg(this.e, MakeMsg, tmpMsg) + Msg.data=Msg.data + .replace(/\n/g, '') + .replace(/(.+?)<\/title>/g, '___') + .replace(/___+/, `<title color="#777777" size="26">${tmpMsg}`) - await this.e.reply(`抽卡记录更新完成,您还可回复\n【#${this?.e?.isSr?'星铁光锥':'武器'}记录】统计${this?.e?.isSr?'星铁光锥':'武器'}池数据\n【#${this?.e?.isSr?'星铁':''}角色统计】按卡池统计数据\n【#导出记录】导出记录数据`) + await this.e.reply(Msg) this.isLogUrl = true