fix(ntfymsg): 修复标题和文本为空时的日志警告问题

当标题和文本都为空时,使用空字符代替空字符串,以避免自动生成 “triggered” 文本。

- 将 `title = msg_body.get("title") or ""` 修改为 `title = msg_body.get("title") or "\u200b"`
- 将 `text = msg_body.get("text") or ""` 修改为 `text = msg_body.get("text") or "\u200b"`
This commit is contained in:
jofyxu
2025-12-21 21:30:46 +08:00
parent af38909f58
commit bde04fd7e1

View File

@@ -353,9 +353,9 @@ class NtfyMsg(_PluginBase):
# 类型
msg_type: NotificationType = msg_body.get("type")
# 标题
title = msg_body.get("title") or ""
title = msg_body.get("title") or "\u200b"
# 文本
text = msg_body.get("text") or ""
text = msg_body.get("text") or "\u200b"
if not title and not text:
logger.warn("标题和内容不能同时为空")