@@ -32,14 +32,16 @@ def post_data(platform, limit, usage, msg, allow_reset=False):
content = msg
markdown = {"msgtype": "markdown", "markdown": {"content": content}}
- text = {
- "msgtype": "text",
- "text": {
- "content": " 请以下同事注意",
- "mentioned_mobile_list": setting.WECHAT_WARNING_PHONES
+ body = {"markdown": markdown}
+ if setting.WECHAT_WARNING_PHONES:
+ text = {
+ "msgtype": "text",
+ "text": {
+ "content": " 请相关同事注意",
+ "mentioned_mobile_list": setting.WECHAT_WARNING_PHONES
+ }
}
- }
- body = {'markdown': markdown, 'text': text}
+ body['text'] = text
return body
@@ -19,9 +19,9 @@ REDISDB_DB = int(os.getenv("REDISDB_DB", 1))
# 企业微信报警
WECHAT_WARNING_URL = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send"
-WECHAT_WARNING_ROBOT_KEY = "683a19fe-c72d-464f-acbe-489656f06b05"
+WECHAT_WARNING_ROBOT_KEY = "d7abfa68-dde5-43bf-a69a-cddcc1cc62fe"
WECHAT_WARNING_PHONES = [
- # "15639297172", # 张金坤
+ # "@all",
]
# 全局限制器