调整一言启用逻辑,默认关闭

This commit is contained in:
Cp0204 2024-11-29 00:01:39 +08:00
parent a1501705c1
commit 1800b1f446
2 changed files with 10 additions and 9 deletions

View File

@ -3,7 +3,7 @@ const got = require('got');
const timeout = 15000;
const push_config = {
HITOKOTO: true, // 启用一言(随机句子)
HITOKOTO: false, // 启用一言(随机句子)
BARK_PUSH: '', // bark IP 或设备码https://api.day.app/DxHcxxxxxRxxxxxxcm/
BARK_ARCHIVE: '', // bark 推送是否存档
@ -1339,7 +1339,7 @@ async function sendNotify(text, desp, params = {}) {
}
}
if (push_config.HITOKOTO !== 'false') {
if (push_config.HITOKOTO && String(push_config.HITOKOTO).toLowerCase() !== 'false') {
desp += '\n\n' + (await one());
}

View File

@ -33,7 +33,7 @@ def print(text, *args, **kw):
# 通知服务
# fmt: off
push_config = {
'HITOKOTO': True, # 启用一言(随机句子)
'HITOKOTO': False, # 启用一言(随机句子)
'BARK_PUSH': '', # bark IP 或设备码https://api.day.app/DxHcxxxxxRxxxxxxcm/
'BARK_ARCHIVE': '', # bark 推送是否存档
@ -1008,7 +1008,8 @@ def send(title: str, content: str, ignore_default_config: bool = False, **kwargs
return
hitokoto = push_config.get("HITOKOTO")
content += "\n\n" + one() if hitokoto != "false" else ""
if hitokoto and str(hitokoto).lower() != "false":
content += "\n\n" + one()
notify_function = add_notify_function()
ts = [