From 13ba9a5afc8428e59009c0484978c0da5eb57e12 Mon Sep 17 00:00:00 2001 From: Aluxes <39981645+AshenAshes@users.noreply.github.com> Date: Thu, 4 Apr 2024 00:29:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E#=E6=98=8E=E6=97=A5=E7=B4=A0?= =?UTF-8?q?=E6=9D=90=20#=E5=91=A8=E4=B8=89=E7=B4=A0=E6=9D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wiki.js | 2 +- apps/wiki/TodayMaterial.js | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/wiki.js b/apps/wiki.js index 62d34c4c..f648bbc9 100644 --- a/apps/wiki.js +++ b/apps/wiki.js @@ -31,7 +31,7 @@ app.reg({ // #今日素材 today: { - rule: /^#(今日|今天|每日|我的)*(素材|材料|天赋)[ |0-9]*$/, + rule: /^#(今日|今天|每日|我的|明天|明日|周([1-7]|一|二|三|四|五|六|日))*(素材|材料|天赋)[ |0-9]*$/, fn: TodayMaterial.render } }) diff --git a/apps/wiki/TodayMaterial.js b/apps/wiki/TodayMaterial.js index 68343658..44ce9c21 100644 --- a/apps/wiki/TodayMaterial.js +++ b/apps/wiki/TodayMaterial.js @@ -10,7 +10,18 @@ const TodayMaterial = { if (now.hour() < 4) { now = now.add(-1, 'days') } + if (/明天|明日/.test(e.msg)) { + now = now.add(1, 'days') + } let week = now.weekday() + + let weekRet = /周([1-7]|一|二|三|四|五|六|日)/.exec(e.msg) + let weekSel = weekRet?.[1] + if (weekSel) { + week = (weekSel * 1) || ('一二三四五六日'.split('').indexOf(weekSel) + 1) + week = week - 1 + } + if (week === 6) { e.reply('今天周日,全部素材都可以刷哦~') return false