mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 14:56:07 +08:00
根据标题跳过消息推送,环境变量:SKIP_PUSH_TITLE 用回车分隔 (#1833)
This commit is contained in:
parent
d342fbf29f
commit
2ff3d9c601
|
@ -296,6 +296,16 @@ async function sendNotify(
|
||||||
) {
|
) {
|
||||||
//提供6种通知
|
//提供6种通知
|
||||||
desp += author; //增加作者信息,防止被贩卖等
|
desp += author; //增加作者信息,防止被贩卖等
|
||||||
|
|
||||||
|
// 根据标题跳过一些消息推送,环境变量:SKIP_PUSH_TITLE 用回车分隔
|
||||||
|
let skipTitle = process.env.SKIP_PUSH_TITLE
|
||||||
|
if(skipTitle) {
|
||||||
|
if(skipTitle.split('\n').includes(text)) {
|
||||||
|
console.info(text + "在SKIP_PUSH_TITLE环境变量内,跳过推送!");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
serverNotify(text, desp), //微信server酱
|
serverNotify(text, desp), //微信server酱
|
||||||
pushPlusNotify(text, desp), //pushplus(推送加)
|
pushPlusNotify(text, desp), //pushplus(推送加)
|
||||||
|
|
|
@ -647,6 +647,13 @@ def send(title: str, content: str) -> None:
|
||||||
print(f"{title} 推送内容为空!")
|
print(f"{title} 推送内容为空!")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# 根据标题跳过一些消息推送,环境变量:SKIP_PUSH_TITLE 用回车分隔
|
||||||
|
skipTitle = os.getenv("SKIP_PUSH_TITLE")
|
||||||
|
if skipTitle:
|
||||||
|
if (title in re.split("\n", skipTitle)):
|
||||||
|
print(f"{title} 在SKIP_PUSH_TITLE环境变量内,跳过推送!")
|
||||||
|
return
|
||||||
|
|
||||||
hitokoto = push_config.get("HITOKOTO")
|
hitokoto = push_config.get("HITOKOTO")
|
||||||
|
|
||||||
text = one() if hitokoto else ""
|
text = one() if hitokoto else ""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user