From f3ad5c9fe8ba784327393f1ea87f165d59efde99 Mon Sep 17 00:00:00 2001 From: kaguramaisakuya <1657974606@qq.com> Date: Sun, 15 Oct 2023 19:10:07 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/apps/gcLog.js | 6 +++--- plugins/other/update.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/genshin/apps/gcLog.js b/plugins/genshin/apps/gcLog.js index 3c7b1d1..27038a5 100644 --- a/plugins/genshin/apps/gcLog.js +++ b/plugins/genshin/apps/gcLog.js @@ -20,15 +20,15 @@ export class gcLog extends plugin { fnc: 'logUrl' }, { - reg: '#txt(日志)?(文件)?导入记录', + reg: '^#txt(日志)?(文件)?导入记录$', fnc: 'logFile' }, { - reg: '#*(原神|星铁)?(xlsx|excel)(文件)?导入记录', + reg: '^#*(原神|星铁)?(xlsx|excel)(文件)?导入记录$', fnc: 'logXlsx' }, { - reg: '#*(原神|星铁)?json(文件)?导入记录', + reg: '^#*(原神|星铁)?json(文件)?导入记录$', fnc: 'logJson' }, { diff --git a/plugins/other/update.js b/plugins/other/update.js index a055e67..179e50c 100644 --- a/plugins/other/update.js +++ b/plugins/other/update.js @@ -19,11 +19,11 @@ export class update extends plugin { priority: 4000, rule: [ { - reg: '^#更新日志$', + reg: '^#更新日志(.*)', fnc: 'updateLog' }, { - reg: '^#(强制)?更新$', + reg: '^#(强制)?更新(.*)', fnc: 'update' }, { From a693e3afbb8448d42bdc3c18f035fa845bdfc66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=89K?= <3399280843@qq.com> Date: Sun, 15 Oct 2023 16:07:10 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E8=BF=99=E7=8E=A9=E6=84=8F=E4=BB=80?= =?UTF-8?q?=E4=B9=88=E6=97=B6=E5=80=99=E6=9C=89(.*)=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E6=97=B6=E9=9B=A8=EF=BC=9A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 曉K <3399280843@qq.com> --- plugins/other/update.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/other/update.js b/plugins/other/update.js index 179e50c..5328f96 100644 --- a/plugins/other/update.js +++ b/plugins/other/update.js @@ -19,11 +19,11 @@ export class update extends plugin { priority: 4000, rule: [ { - reg: '^#更新日志(.*)', + reg: '^#更新日志', fnc: 'updateLog' }, { - reg: '^#(强制)?更新(.*)', + reg: '^#(强制)?更新', fnc: 'update' }, { From f429cb215a8e168ca649179f44093c9c15ca3bef Mon Sep 17 00:00:00 2001 From: Jinx <41286675+1055169799@users.noreply.github.com> Date: Mon, 16 Oct 2023 03:56:05 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=9B=9B=E6=98=9F?= =?UTF-8?q?=E6=AD=A6=E5=99=A8=E6=95=B0=E6=8D=AE=E6=9D=A5=E6=BA=90=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=89=E6=98=9F=E6=AD=A6=E5=99=A8=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=B1=95=E7=A4=BA=20(#283)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修正四型武器数据来源,增加三星武器数量展示 修正四型武器数据来源,增加三星武器数量展示 * 增加三星武器数量展示样式 增加三星武器数量展示样式 * 增加三星武器数量展示 增加三星武器数量展示 --- plugins/genshin/model/weapon.js | 2 ++ plugins/genshin/resources/html/weapon/weapon.css | 7 +++++++ plugins/genshin/resources/html/weapon/weapon.html | 8 ++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/plugins/genshin/model/weapon.js b/plugins/genshin/model/weapon.js index 6437728..fa5e61b 100644 --- a/plugins/genshin/model/weapon.js +++ b/plugins/genshin/model/weapon.js @@ -45,6 +45,7 @@ export default class Weapon extends base { let count = { five: 0, four: 0, + three: 0, 单手剑: 0, 双手剑: 0, 长柄武器: 0, @@ -64,6 +65,7 @@ export default class Weapon extends base { if (val.weapon.rarity == 5) count.five++ if (val.weapon.rarity == 4) count.four++ + if (val.weapon.rarity == 3) count.three++ count[val.weapon.type_name]++ diff --git a/plugins/genshin/resources/html/weapon/weapon.css b/plugins/genshin/resources/html/weapon/weapon.css index e6903ef..e07c5d3 100644 --- a/plugins/genshin/resources/html/weapon/weapon.css +++ b/plugins/genshin/resources/html/weapon/weapon.css @@ -87,6 +87,13 @@ body { border-radius: 100%; margin-right: 4px; } +.lab-item-3{ + background: #4c99b9; + width: 6px; + height: 6px; + border-radius: 100%; + margin-right: 4px; +} .lab-item-weapon{ width: 16px; height: 16px; diff --git a/plugins/genshin/resources/html/weapon/weapon.html b/plugins/genshin/resources/html/weapon/weapon.html index 767f29a..e9864a8 100644 --- a/plugins/genshin/resources/html/weapon/weapon.html +++ b/plugins/genshin/resources/html/weapon/weapon.html @@ -19,7 +19,11 @@
-
四星:{{count.five}}
+
四星:{{count.four}}
+
+
+
+
三星:{{count.three}}
@@ -74,4 +78,4 @@ - \ No newline at end of file + From 2ab062f4f2d837de1693602f68e5dfe6777ff9e7 Mon Sep 17 00:00:00 2001 From: Zyy955 <74231782+Zyy955@users.noreply.github.com> Date: Mon, 16 Oct 2023 03:56:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8A=A0=E4=B8=AA=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=EF=BC=8C=E9=98=B2=E6=AD=A2=E6=97=A0=E6=84=8F=E4=B9=89=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E5=AF=BC=E8=87=B4=E8=BD=AC=E5=8F=91=E6=95=B4?= =?UTF-8?q?=E4=B8=AA=E6=97=A0=E6=B3=95=E5=8F=91=E9=80=81=20(#284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 加个捕获,防止无意义的报错导致转发整个无法发送 * 更新 common.js --- lib/common/common.js | 50 +++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/lib/common/common.js b/lib/common/common.js index cf82dd7..f0e500e 100644 --- a/lib/common/common.js +++ b/lib/common/common.js @@ -77,8 +77,12 @@ async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) { let id = msgsscr ? e.user_id : Bot.uin if (e.isGroup) { - let info = await e.bot.getGroupMemberInfo(e.group_id, id) - name = info.card || info.nickname + try { + let info = await e.bot.getGroupMemberInfo(e.group_id, id) + name = info.card || info.nickname + } catch (err) { + logger.error(err) + } } let userInfo = { @@ -98,27 +102,31 @@ async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) { } /** 制作转发内容 */ - if (e?.group?.makeForwardMsg) { - forwardMsg = await e.group.makeForwardMsg(forwardMsg) - } else if (e?.friend?.makeForwardMsg) { - forwardMsg = await e.friend.makeForwardMsg(forwardMsg) - } else { - return msg.join('\n') - } - - if (dec) { - /** 处理描述 */ - if (typeof (forwardMsg.data) === 'object') { - let detail = forwardMsg.data?.meta?.detail - if (detail) { - detail.news = [{ text: dec }] - } + try { + if (e?.group?.makeForwardMsg) { + forwardMsg = await e.group.makeForwardMsg(forwardMsg) + } else if (e?.friend?.makeForwardMsg) { + forwardMsg = await e.friend.makeForwardMsg(forwardMsg) } else { - forwardMsg.data = forwardMsg.data - .replace(/\n/g, '') - .replace(/(.+?)<\/title>/g, '___') - .replace(/___+/, `<title color="#777777" size="26">${dec}`) + return msg.join('\n') } + + if (dec) { + /** 处理描述 */ + if (typeof (forwardMsg.data) === 'object') { + let detail = forwardMsg.data?.meta?.detail + if (detail) { + detail.news = [{ text: dec }] + } + } else { + forwardMsg.data = forwardMsg.data + .replace(/\n/g, '') + .replace(/(.+?)<\/title>/g, '___') + .replace(/___+/, `<title color="#777777" size="26">${dec}`) + } + } + } catch (err) { + logger.error(err) } return forwardMsg