This commit is contained in:
2025-09-29 23:22:12 +08:00
parent 915f186955
commit 90ee296f55

View File

@ -124,13 +124,13 @@ def get_target_time(content: str) -> datetime.datetime | None:
hour = parse_chinese_or_digit(match4.group(1))
if hour < 0 or hour > 23:
return
t = t.replace(hour=hour)
t = t.replace(hour=hour, minute=0, second=0)
if match5 := re.match(PATTERN_MINUTE_SPECIFY, content_to_match):
content_to_match = "".join(content_to_match.split(match5.group(0)))
minute = parse_chinese_or_digit(match5.group(1))
if minute < 0 or minute > 59:
return
t = t.replace(minute=minute)
t = t.replace(minute=minute, second=0)
if match6 := re.match(PATTERN_SECOND_SPECIFY, content_to_match):
content_to_match = "".join(content_to_match.split(match6.group(0)))
second = parse_chinese_or_digit(match6.group(1))
@ -241,7 +241,7 @@ async def notify_now(notify: Notify):
await bot.send_group_msg(
group_id=int(notify.target_env),
message=cast(Any,
await UniMessage().at(notify.target).text(f"代办通知:{notify.notify_msg}").export()
await UniMessage().at(notify.target).text(f" 代办通知:{notify.notify_msg}").export()
),
)
else:
@ -322,7 +322,8 @@ async def _(msg: UniMsg, mEvt: Event):
save_notify_config(cfg)
DATA_FILE_LOCK.release()
await evt.send(f"了解啦!将会在 {notify.notify_time} 提醒你哦~")
await evt.send(await UniMessage().at(mEvt.get_user_id()).text(
f" 了解啦!将会在 {notify.notify_time} 提醒你哦~").export())
driver = nonebot.get_driver()