mirror of
https://github.com/xuthus83/LittlePaimon.git
synced 2025-04-12 23:29:37 +08:00
🐛 fix bug
This commit is contained in:
parent
bb46af8f57
commit
7b6b8128eb
@ -1,7 +1,6 @@
|
|||||||
import re
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from nonebot import on_endswith, on_command, on_regex
|
from nonebot import on_command, on_regex
|
||||||
from nonebot.adapters.onebot.v11 import MessageEvent, Message, MessageSegment
|
from nonebot.adapters.onebot.v11 import MessageEvent, Message, MessageSegment
|
||||||
from nonebot.adapters.onebot.v11.helpers import is_cancellation
|
from nonebot.adapters.onebot.v11.helpers import is_cancellation
|
||||||
from nonebot.adapters.onebot.v11.exception import ActionFailed
|
from nonebot.adapters.onebot.v11.exception import ActionFailed
|
||||||
@ -40,7 +39,7 @@ __plugin_meta__ = PluginMetadata(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
daily_material = on_endswith(('材料', '天赋材料', '突破材料'), priority=6, block=True)
|
daily_material = on_regex(r'(?P<week>今日|今天|现在|明天|明日|后天|后日|周一|周二|周三|周四|周五|周六|周日)(天赋|角色)?材料', priority=12, block=True)
|
||||||
daily_material.__paimon_help__ = {
|
daily_material.__paimon_help__ = {
|
||||||
"usage": '<今日|周x>材料',
|
"usage": '<今日|周x>材料',
|
||||||
"introduce": "查看可刷取的素材表",
|
"introduce": "查看可刷取的素材表",
|
||||||
@ -61,35 +60,32 @@ abyss_team.__paimon_help__ = {
|
|||||||
|
|
||||||
|
|
||||||
@daily_material.handle()
|
@daily_material.handle()
|
||||||
async def daily_material_handle(event: MessageEvent):
|
async def daily_material_handle(event: MessageEvent, find_week: dict = RegexDict()):
|
||||||
if not (
|
if find_week['week'] in ['今日', '今天', '现在']:
|
||||||
week := event.message.extract_plain_text().replace('材料', '').replace('天赋材料', '').replace('突破材料',
|
week = time.strftime("%w")
|
||||||
'').strip()):
|
elif find_week['week'] in ['明日', '明天']:
|
||||||
return
|
week = str(int(time.strftime("%w")) + 1)
|
||||||
if find_week := re.search('(?P<week>今日|今天|现在|明天|明日|后天|后日|周一|周二|周三|周四|周五|周六|周日)', week):
|
elif find_week['week'] in ['后日', '后天']:
|
||||||
if find_week['week'] in ['今日', '今天', '现在']:
|
week = str(int(time.strftime("%w")) + 2)
|
||||||
week = time.strftime("%w")
|
elif find_week['week'] in ['周一', '周四']:
|
||||||
elif find_week['week'] in ['明日', '明天']:
|
week = '1'
|
||||||
week = str(int(time.strftime("%w")) + 1)
|
elif find_week['week'] in ['周二', '周五']:
|
||||||
elif find_week['week'] in ['后日', '后天']:
|
week = '2'
|
||||||
week = str(int(time.strftime("%w")) + 2)
|
elif find_week['week'] in ['周三', '周六']:
|
||||||
elif find_week['week'] in ['周一', '周四']:
|
week = '3'
|
||||||
week = '1'
|
else:
|
||||||
elif find_week['week'] in ['周二', '周五']:
|
week = '0'
|
||||||
week = '2'
|
if week == "0":
|
||||||
elif find_week['week'] in ['周三', '周六']:
|
await daily_material.finish('周日所有材料都可以刷哦!', at_sender=True)
|
||||||
week = '3'
|
elif week in ['1', '4']:
|
||||||
else:
|
await daily_material.finish(
|
||||||
week = '0'
|
MessageSegment.image(file='https://static.cherishmoon.fun/LittlePaimon/DailyMaterials/周一周四.jpg'))
|
||||||
if week == "0":
|
elif week in ['2', '5']:
|
||||||
await daily_material.finish('周日所有材料都可以刷哦!', at_sender=True)
|
await daily_material.finish(
|
||||||
elif week in ['1', '4']:
|
MessageSegment.image(file='https://static.cherishmoon.fun/LittlePaimon/DailyMaterials/周二周五.jpg'))
|
||||||
url = 'LittlePaimon/DailyMaterials/周一周四.jpg'
|
else:
|
||||||
elif week in ['2', '5']:
|
await daily_material.finish(
|
||||||
url = 'LittlePaimon/DailyMaterials/周二周五.jpg'
|
MessageSegment.image(file='https://static.cherishmoon.fun/LittlePaimon/DailyMaterials/周三周六.jpg'))
|
||||||
else:
|
|
||||||
url = 'LittlePaimon/DailyMaterials/周三周六.jpg'
|
|
||||||
await daily_material.finish(await MessageBuild.StaticImage(url=url))
|
|
||||||
|
|
||||||
|
|
||||||
@abyss_rate.handle()
|
@abyss_rate.handle()
|
||||||
@ -128,7 +124,7 @@ def create_wiki_matcher(pattern: str, help_fun: str, help_name: str):
|
|||||||
state['img_url'] = 'https://static.cherishmoon.fun/LittlePaimon/XFGuide/{}.jpg'
|
state['img_url'] = 'https://static.cherishmoon.fun/LittlePaimon/XFGuide/{}.jpg'
|
||||||
elif state['type'] == '角色材料':
|
elif state['type'] == '角色材料':
|
||||||
state['type'] = '角色'
|
state['type'] = '角色'
|
||||||
state['img_url'] = 'https://static.cherishmoon.fun/LittlePaimon/RoleMaterials/{}.jpg'
|
state['img_url'] = 'https://static.cherishmoon.fun/LittlePaimon/RoleMaterials/{}材料.jpg'
|
||||||
elif state['type'] == '收益曲线':
|
elif state['type'] == '收益曲线':
|
||||||
state['type'] = '角色'
|
state['type'] = '角色'
|
||||||
state['img_url'] = 'https://static.cherishmoon.fun/LittlePaimon/blue/{}.jpg'
|
state['img_url'] = 'https://static.cherishmoon.fun/LittlePaimon/blue/{}.jpg'
|
||||||
|
@ -740,6 +740,9 @@
|
|||||||
"深林的记忆生之花",
|
"深林的记忆生之花",
|
||||||
"草套",
|
"草套",
|
||||||
"艹套"
|
"艹套"
|
||||||
|
],
|
||||||
|
"礼冠": [
|
||||||
|
"礼冠"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"原魔": [
|
"原魔": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user