根据标题跳过消息推送,环境变量:SKIP_PUSH_TITLE 用回车分隔 (#1833)

This commit is contained in:
pharaoh2012
2023-03-03 21:59:44 +08:00
committed by GitHub
parent d342fbf29f
commit 2ff3d9c601
2 changed files with 17 additions and 0 deletions
+7
View File
@@ -647,6 +647,13 @@ def send(title: str, content: str) -> None:
print(f"{title} 推送内容为空!")
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")
text = one() if hitokoto else ""