重构 ptimeparse 模块

This commit is contained in:
2025-11-21 06:03:28 +08:00
parent f6e7dfcd93
commit 3e5c1941c8
11 changed files with 2058 additions and 645 deletions

View File

@ -3,6 +3,7 @@ import asyncio as asynkio
from math import ceil
from pathlib import Path
from typing import Any
import datetime
import nanoid
import nonebot
@ -13,7 +14,7 @@ from nonebot_plugin_alconna import Alconna, Args, Subcommand, UniMessage, UniMsg
from pydantic import BaseModel
from konabot.common.longtask import DepLongTaskTarget, LongTask, create_longtask, handle_long_task, longtask_data
from konabot.common.ptimeparse import Parser
from konabot.common.ptimeparse import parse
evt = on_message()
@ -84,7 +85,7 @@ async def _(msg: UniMsg, mEvt: Event, target: DepLongTaskTarget):
notify_time, notify_text = segments
try:
target_time = Parser().parse(notify_time)
target_time = parse(notify_time)
logger.info(f"{notify_time} 解析出了时间:{target_time}")
except Exception:
logger.info(f"无法从 {notify_time} 中解析出时间")