mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 14:38:30 +00:00
新增#明日素材 #周三素材
This commit is contained in:
parent
56d222f8df
commit
13ba9a5afc
@ -31,7 +31,7 @@ app.reg({
|
||||
|
||||
// #今日素材
|
||||
today: {
|
||||
rule: /^#(今日|今天|每日|我的)*(素材|材料|天赋)[ |0-9]*$/,
|
||||
rule: /^#(今日|今天|每日|我的|明天|明日|周([1-7]|一|二|三|四|五|六|日))*(素材|材料|天赋)[ |0-9]*$/,
|
||||
fn: TodayMaterial.render
|
||||
}
|
||||
})
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user