MCPcopy Create free account
hub / github.com/smallfawn/QLScriptPublic / send

Function send

notify.py:1071–1099  ·  view source on GitHub ↗
(title: str, content: str, ignore_default_config: bool = False, **kwargs)

Source from the content-addressed store, hash-verified

1069
1070
1071def send(title: str, content: str, ignore_default_config: bool = False, **kwargs):
1072 if kwargs:
1073 global push_config
1074 if ignore_default_config:
1075 push_config = kwargs # 清空从环境变量获取的配置
1076 else:
1077 push_config.update(kwargs)
1078
1079 if not content:
1080 print(f"{title} 推送内容为空!")
1081 return
1082
1083 # 根据标题跳过一些消息推送,环境变量:SKIP_PUSH_TITLE 用回车分隔
1084 skipTitle = os.getenv("SKIP_PUSH_TITLE")
1085 if skipTitle:
1086 if title in re.split("\n", skipTitle):
1087 print(f"{title} 在SKIP_PUSH_TITLE环境变量内,跳过推送!")
1088 return
1089
1090 hitokoto = push_config.get("HITOKOTO")
1091 content += "\n\n" + one() if hitokoto != "false" else ""
1092
1093 notify_function = add_notify_function()
1094 ts = [
1095 threading.Thread(target=mode, args=(title, content), name=mode.__name__)
1096 for mode in notify_function
1097 ]
1098 [t.start() for t in ts]
1099 [t.join() for t in ts]
1100
1101
1102def main():

Callers 2

check_signFunction · 0.90
mainFunction · 0.70

Calls 4

printFunction · 0.70
oneFunction · 0.70
add_notify_functionFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected