mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 08:26:06 +08:00
调整一言启用逻辑,默认不启用
This commit is contained in:
parent
1aa9a06989
commit
24d2e45bd5
|
@ -33,7 +33,7 @@ def print(text, *args, **kw):
|
||||||
# 通知服务
|
# 通知服务
|
||||||
# fmt: off
|
# fmt: off
|
||||||
push_config = {
|
push_config = {
|
||||||
'HITOKOTO': True, # 启用一言(随机句子)
|
'HITOKOTO': True, # 启用一言(随机句子)
|
||||||
|
|
||||||
'BARK_PUSH': '', # bark IP 或设备码,例:https://api.day.app/DxHcxxxxxRxxxxxxcm/
|
'BARK_PUSH': '', # bark IP 或设备码,例:https://api.day.app/DxHcxxxxxRxxxxxxcm/
|
||||||
'BARK_ARCHIVE': '', # bark 推送是否存档
|
'BARK_ARCHIVE': '', # bark 推送是否存档
|
||||||
|
@ -43,7 +43,7 @@ push_config = {
|
||||||
'BARK_LEVEL': '', # bark 推送时效性
|
'BARK_LEVEL': '', # bark 推送时效性
|
||||||
'BARK_URL': '', # bark 推送跳转URL
|
'BARK_URL': '', # bark 推送跳转URL
|
||||||
|
|
||||||
'CONSOLE': False, # 控制台输出
|
'CONSOLE': False, # 控制台输出
|
||||||
|
|
||||||
'DD_BOT_SECRET': '', # 钉钉机器人的 DD_BOT_SECRET
|
'DD_BOT_SECRET': '', # 钉钉机器人的 DD_BOT_SECRET
|
||||||
'DD_BOT_TOKEN': '', # 钉钉机器人的 DD_BOT_TOKEN
|
'DD_BOT_TOKEN': '', # 钉钉机器人的 DD_BOT_TOKEN
|
||||||
|
@ -77,7 +77,7 @@ push_config = {
|
||||||
|
|
||||||
'WE_PLUS_BOT_TOKEN': '', # 微加机器人的用户令牌
|
'WE_PLUS_BOT_TOKEN': '', # 微加机器人的用户令牌
|
||||||
'WE_PLUS_BOT_RECEIVER': '', # 微加机器人的消息接收者
|
'WE_PLUS_BOT_RECEIVER': '', # 微加机器人的消息接收者
|
||||||
'WE_PLUS_BOT_VERSION': 'pro', # 微加机器人的调用版本
|
'WE_PLUS_BOT_VERSION': 'pro', # 微加机器人的调用版本
|
||||||
|
|
||||||
'QMSG_KEY': '', # qmsg 酱的 QMSG_KEY
|
'QMSG_KEY': '', # qmsg 酱的 QMSG_KEY
|
||||||
'QMSG_TYPE': '', # qmsg 酱的 QMSG_TYPE
|
'QMSG_TYPE': '', # qmsg 酱的 QMSG_TYPE
|
||||||
|
@ -817,7 +817,7 @@ def ntfy(title: str, content: str) -> None:
|
||||||
print("ntfy 服务的NTFY_PRIORITY 未设置!!默认设置为3")
|
print("ntfy 服务的NTFY_PRIORITY 未设置!!默认设置为3")
|
||||||
else:
|
else:
|
||||||
priority = push_config.get("NTFY_PRIORITY")
|
priority = push_config.get("NTFY_PRIORITY")
|
||||||
|
|
||||||
# 使用 RFC 2047 编码 title
|
# 使用 RFC 2047 编码 title
|
||||||
encoded_title = encode_rfc2047(title)
|
encoded_title = encode_rfc2047(title)
|
||||||
|
|
||||||
|
@ -826,7 +826,7 @@ def ntfy(title: str, content: str) -> None:
|
||||||
"Title": encoded_title, # 使用编码后的 title
|
"Title": encoded_title, # 使用编码后的 title
|
||||||
"Priority": priority
|
"Priority": priority
|
||||||
}
|
}
|
||||||
|
|
||||||
url = push_config.get("NTFY_URL") + "/" + push_config.get("NTFY_TOPIC")
|
url = push_config.get("NTFY_URL") + "/" + push_config.get("NTFY_TOPIC")
|
||||||
response = requests.post(url, data=data, headers=headers)
|
response = requests.post(url, data=data, headers=headers)
|
||||||
if response.status_code == 200: # 使用 response.status_code 进行检查
|
if response.status_code == 200: # 使用 response.status_code 进行检查
|
||||||
|
@ -1020,7 +1020,7 @@ def send(title: str, content: str, ignore_default_config: bool = False, **kwargs
|
||||||
print(f"{title} 在SKIP_PUSH_TITLE环境变量内,跳过推送!")
|
print(f"{title} 在SKIP_PUSH_TITLE环境变量内,跳过推送!")
|
||||||
return
|
return
|
||||||
|
|
||||||
hitokoto = push_config.get("HITOKOTO")
|
hitokoto = push_config.get("HITOKOTO", "false")
|
||||||
content += "\n\n" + one() if hitokoto != "false" else ""
|
content += "\n\n" + one() if hitokoto != "false" else ""
|
||||||
|
|
||||||
notify_function = add_notify_function()
|
notify_function = add_notify_function()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user