mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
调整一言启用逻辑,默认关闭
This commit is contained in:
parent
a1501705c1
commit
1800b1f446
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user