支持剧诗版本深渊下期

This commit is contained in:
KimigaiiWuyi 2025-02-15 17:37:23 +08:00
parent 3f61e556ee
commit 1eb20269cb
2 changed files with 10 additions and 3 deletions

View File

@ -62,7 +62,7 @@ async def send_bluekun_pic(bot: Bot, ev: Event):
@sv_poetry_abyss_review.on_command(('剧诗版本深渊', '剧诗深渊阵容'))
async def send_poetry_abyss_review(bot: Bot, ev: Event):
im = await draw_poetry_abyss_image()
im = await draw_poetry_abyss_image(ev.text.strip())
logger.info('[剧诗版本深渊] 获得深渊信息成功!')
await bot.send(im)

View File

@ -36,7 +36,7 @@ def is_current_time_in_range(start_time: str, end_time: str) -> bool:
return start_datetime <= current_datetime <= end_datetime
async def draw_poetry_abyss_image():
async def draw_poetry_abyss_image(v: str):
data = await hakush_api.get_hakush_rolecombats()
if isinstance(data, int):
return get_error(data)
@ -47,7 +47,14 @@ async def draw_poetry_abyss_image():
begin = item['begin']
end = item['end']
if is_current_time_in_range(begin, end):
poetry_id = _id
if '' in v:
poetry_id = str(int(_id) + 1)
if poetry_id not in data:
return (
'没有找到下期的阵容, 可能暂未更新, 请尝试查找当期阵容!'
)
else:
poetry_id = _id
break
else:
return '没有找到当前的活动!'