新增#明日素材 #周三素材

This commit is contained in:
Aluxes 2024-04-04 00:29:56 +08:00
parent 56d222f8df
commit 13ba9a5afc
No known key found for this signature in database
GPG Key ID: 6696152F9C003087
2 changed files with 12 additions and 1 deletions

View File

@ -31,7 +31,7 @@ app.reg({
// #今日素材
today: {
rule: /^#(今日|今天|每日|我的)*(素材|材料|天赋)[ |0-9]*$/,
rule: /^#(今日|今天|每日|我的|明天|明日|周([1-7]|一|二|三|四|五|六|日))*(素材|材料|天赋)[ |0-9]*$/,
fn: TodayMaterial.render
}
})

View File

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