修复未开启一言时多余空行, 通知渠道改发送前检查 (#2222)

This commit is contained in:
Cp0204 2024-01-25 13:14:26 +08:00 committed by GitHub
parent 7f3e60423b
commit 35c6475534
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -841,6 +841,7 @@ def one() -> str:
return res["hitokoto"] + " ----" + res["from"]
def add_notify_function():
if push_config.get("BARK_PUSH"):
notify_function.append(bark)
if push_config.get("CONSOLE"):
@ -910,10 +911,9 @@ def send(title: str, content: str) -> None:
return
hitokoto = push_config.get("HITOKOTO")
content += "\n\n" + one() if hitokoto else ""
text = one() if hitokoto else ""
content += "\n\n" + text
add_notify_function()
ts = [
threading.Thread(target=mode, args=(title, content), name=mode.__name__)
for mode in notify_function