From c94db33b1150a5f84de9549f26b8430d891c5367 Mon Sep 17 00:00:00 2001 From: passthem Date: Sun, 19 Oct 2025 22:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ptimeparse=20=E5=88=B0=200?= =?UTF-8?q?.2.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- konabot/plugins/simple_notify/__init__.py | 3 +- poetry.lock | 8 ++--- pyproject.toml | 42 +++++++++++------------ 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/konabot/plugins/simple_notify/__init__.py b/konabot/plugins/simple_notify/__init__.py index 6cd53b5..7ceeb86 100644 --- a/konabot/plugins/simple_notify/__init__.py +++ b/konabot/plugins/simple_notify/__init__.py @@ -162,7 +162,8 @@ async def _(msg: UniMsg, mEvt: Event): notify_time, notify_text = segments # target_time = get_target_time(notify_time) try: - target_time = ptimeparse.parse(notify_time) + # target_time = ptimeparse.parse(notify_time) + target_time = ptimeparse.Parser().parse(notify_time) logger.info(f"从 {notify_time} 解析出了时间:{target_time}") except Exception: logger.info(f"无法从 {notify_time} 中解析出时间") diff --git a/poetry.lock b/poetry.lock index bbe3494..808201c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2402,14 +2402,14 @@ reference = "mirrors" [[package]] name = "ptimeparse" -version = "0.1.2" +version = "0.2.0" description = "一个用于解析中文的时间表达的库" optional = false python-versions = ">=3.9" groups = ["main"] files = [ - {file = "ptimeparse-0.1.2-py3-none-any.whl", hash = "sha256:0eea791396e53b63330fadb40d9f0a2e6272bd5467246f10d1d6971bc606edff"}, - {file = "ptimeparse-0.1.2.tar.gz", hash = "sha256:658be90a3cc2994c09c4ea2f276d257e7eb84bc330be79950baefe32b19779a2"}, + {file = "ptimeparse-0.2.0-py3-none-any.whl", hash = "sha256:57055f8fd99fb69e19deac3b8a5c7ac91af86c7ac09781632e9abf318df0d6d2"}, + {file = "ptimeparse-0.2.0.tar.gz", hash = "sha256:867c265f2e157fe4d793d20fe9c449b8ede5c855f336d7e6b2eb78551e622766"}, ] [package.source] @@ -3807,4 +3807,4 @@ reference = "mirrors" [metadata] lock-version = "2.1" python-versions = ">=3.12,<4.0" -content-hash = "d6a325b769fb3ed207c1a8891e65ea20bae20166fa281d6fa620faf54ad15bd8" +content-hash = "02530953efe65da1a788845cd43f8856be62db5bfb59de691cad813f57bab25e" diff --git a/pyproject.toml b/pyproject.toml index 4cfa4e7..a509d07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,30 +2,28 @@ name = "konabot" version = "0.1.0" description = "在 MTTU 内部使用的 bot" -authors = [ - {name = "passthem",email = "Passthem183@gmail.com"} -] +authors = [{ name = "passthem", email = "Passthem183@gmail.com" }] readme = "README.md" requires-python = ">=3.12,<4.0" dependencies = [ - "nonebot2[all] (>=2.4.3,<3.0.0)", - "nonebot-adapter-onebot (>=2.4.6,<3.0.0)", - "nonebot-adapter-console (>=0.9.0,<0.10.0)", - "nonebot-adapter-discord (>=0.1.8,<0.2.0)", - "nonebot-adapter-minecraft (>=1.5.2,<2.0.0)", - "nonebot-plugin-alconna (>=0.59.4,<0.60.0)", - "nonebot-plugin-apscheduler (>=0.5.0,<0.6.0)", - "requests (>=2.32.5,<3.0.0)", - "beautifulsoup4 (>=4.13.5,<5.0.0)", - "lxml (>=6.0.2,<7.0.0)", - "pillow (>=11.3.0,<12.0.0)", - "imagetext-py (>=2.2.0,<3.0.0)", - "opencv-python-headless (>=4.12.0.88,<5.0.0.0)", - "returns (>=0.26.0,<0.27.0)", - "ptimeparse (>=0.1.1,<0.2.0)", - "skia-python (>=138.0,<139.0)", - "nonebot-plugin-analysis-bilibili (>=2.8.1,<3.0.0)", - "qrcode (>=8.2,<9.0)", + "nonebot2[all] (>=2.4.3,<3.0.0)", + "nonebot-adapter-onebot (>=2.4.6,<3.0.0)", + "nonebot-adapter-console (>=0.9.0,<0.10.0)", + "nonebot-adapter-discord (>=0.1.8,<0.2.0)", + "nonebot-adapter-minecraft (>=1.5.2,<2.0.0)", + "nonebot-plugin-alconna (>=0.59.4,<0.60.0)", + "nonebot-plugin-apscheduler (>=0.5.0,<0.6.0)", + "requests (>=2.32.5,<3.0.0)", + "beautifulsoup4 (>=4.13.5,<5.0.0)", + "lxml (>=6.0.2,<7.0.0)", + "pillow (>=11.3.0,<12.0.0)", + "imagetext-py (>=2.2.0,<3.0.0)", + "opencv-python-headless (>=4.12.0.88,<5.0.0.0)", + "returns (>=0.26.0,<0.27.0)", + "ptimeparse (>=0.1.1,<1.0.0)", + "skia-python (>=138.0,<139.0)", + "nonebot-plugin-analysis-bilibili (>=2.8.1,<3.0.0)", + "qrcode (>=8.2,<9.0)", ] [build-system] @@ -43,4 +41,4 @@ url = "https://pypi.tuna.tsinghua.edu.cn/simple/" priority = "primary" [tool.poetry.dependencies] -ptimeparse = {source = "pt-gitea-pypi"} +ptimeparse = { source = "pt-gitea-pypi" }