mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
serverJ自定义参数
This commit is contained in:
parent
239ab821c3
commit
bcd7bcd0c1
|
@ -304,20 +304,21 @@ def iGot(title: str, content: str, **kwargs) -> None:
|
||||||
print(f'iGot 推送失败!{response["errMsg"]}')
|
print(f'iGot 推送失败!{response["errMsg"]}')
|
||||||
|
|
||||||
|
|
||||||
def serverJ(title: str, content: str) -> None:
|
def serverJ(title: str, content: str, **kwargs) -> None:
|
||||||
"""
|
"""
|
||||||
通过 serverJ 推送消息。
|
通过 serverJ 推送消息。
|
||||||
"""
|
"""
|
||||||
if not push_config.get("PUSH_KEY"):
|
if not (kwargs.get("PUSH_KEY") or push_config.get("PUSH_KEY")):
|
||||||
print("serverJ 服务的 PUSH_KEY 未设置!!\n取消推送")
|
print("serverJ 服务的 PUSH_KEY 未设置!!\n取消推送")
|
||||||
return
|
return
|
||||||
print("serverJ 服务启动")
|
print("serverJ 服务启动")
|
||||||
|
PUSH_KEY = kwargs.get("PUSH_KEY", push_config.get("PUSH_KEY"))
|
||||||
|
|
||||||
data = {"text": title, "desp": content.replace("\n", "\n\n")}
|
data = {"text": title, "desp": content.replace("\n", "\n\n")}
|
||||||
if push_config.get("PUSH_KEY").find("SCT") != -1:
|
if PUSH_KEY.find("SCT") != -1:
|
||||||
url = f'https://sctapi.ftqq.com/{push_config.get("PUSH_KEY")}.send'
|
url = f'https://sctapi.ftqq.com/{PUSH_KEY}.send'
|
||||||
else:
|
else:
|
||||||
url = f'https://sc.ftqq.com/{push_config.get("PUSH_KEY")}.send'
|
url = f'https://sc.ftqq.com/{PUSH_KEY}.send'
|
||||||
response = requests.post(url, data=data).json()
|
response = requests.post(url, data=data).json()
|
||||||
|
|
||||||
if response.get("errno") == 0 or response.get("code") == 0:
|
if response.get("errno") == 0 or response.get("code") == 0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user