From 966e740efc340587ceec0c11c60ab2aa420e3193 Mon Sep 17 00:00:00 2001 From: balh55y <85926883+balh55y@users.noreply.github.com> Date: Fri, 2 Dec 2022 19:09:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E5=91=A8=E8=AF=9D?= =?UTF-8?q?=E5=94=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_dialectlist/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nonebot_plugin_dialectlist/__init__.py b/nonebot_plugin_dialectlist/__init__.py index 213e39c..da755c4 100644 --- a/nonebot_plugin_dialectlist/__init__.py +++ b/nonebot_plugin_dialectlist/__init__.py @@ -72,6 +72,7 @@ rankings = on_command( "今日群话痨排行榜", "昨日群话痨排行榜", "本周群话痨排行榜", + "上周群话痨排行榜", "本月群话痨排行榜", "年度群话痨排行榜", "历史群话痨排行榜", @@ -109,6 +110,13 @@ async def _group_message( hour=0, minute=0, second=0, microsecond=0 ) - timedelta(days=dt.weekday()) state["stop"] = dt + elif command == "上周群话痨排行榜": + state["start"] = dt.replace( + hour=0, minute=0, second=0, microsecond=0 + ) - timedelta(days=dt.weekday() + 7) + state["stop"] = dt.replace( + hour=0, minute=0, second=0, microsecond=0 + ) - timedelta(days=dt.weekday()) elif command == "本月群话痨排行榜": state["start"] = dt.replace(day=1, hour=0, minute=0, second=0, microsecond=0) state["stop"] = dt