This commit is contained in:
xtaodada 2022-01-04 17:23:27 +08:00
parent 0fac77a774
commit aa87765ff1
No known key found for this signature in database
GPG Key ID: EE4DC37B55E24736
2 changed files with 2 additions and 2 deletions

View File

@ -792,7 +792,7 @@
},
{
"name": "moyu",
"version": "1.01",
"version": "1.02",
"section": "daily",
"maintainer": "sam01101",
"size": "3.00 kb",

View File

@ -2,7 +2,6 @@
import datetime
from random import choice
from typing import Optional
import pytz
from pagermaid import bot
@ -68,6 +67,7 @@ def gen_text():
result.append(f"\n**今天就是{fest_name}节,好好享受!**\n")
else:
fest_day_start_year = now.year + (1 if now_month > fest_month else 0)
fest_day_start_year = fest_day_start_year + (1 if (now_month == fest_month and now_day > fest_day) else 0)
fest_day_start = datetime.datetime(fest_day_start_year, fest_month, fest_day).replace(
tzinfo=pytz.timezone("Asia/Shanghai"))
time_left = abs((fest_day_start - now if fest_month == fest_day == 1 else now - fest_day_start).days)