增加上周话唠

This commit is contained in:
balh55y 2022-12-02 19:09:10 +08:00 committed by GitHub
parent f9094f49e6
commit 966e740efc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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