|
@@ -13,11 +13,13 @@ members = ["13726204048", "18860455786"]
|
|
class DingTalkUtils:
|
|
class DingTalkUtils:
|
|
"""
|
|
"""
|
|
@phone Str
|
|
@phone Str
|
|
|
|
+
|
|
|
|
+ 不填:默认@所有人
|
|
可多个,按英文逗号隔开
|
|
可多个,按英文逗号隔开
|
|
可填 【ramdom】 随机发送
|
|
可填 【ramdom】 随机发送
|
|
"""
|
|
"""
|
|
def send(msg, phone=""):
|
|
def send(msg, phone=""):
|
|
- if phone == "all":
|
|
|
|
|
|
+ if phone == "":
|
|
isAtall = True
|
|
isAtall = True
|
|
atMobiles = []
|
|
atMobiles = []
|
|
|
|
|
|
@@ -33,7 +35,7 @@ class DingTalkUtils:
|
|
data = {'msgtype': 'text',
|
|
data = {'msgtype': 'text',
|
|
"at": {"isAtAll": isAtall,
|
|
"at": {"isAtAll": isAtall,
|
|
"atMobiles": atMobiles},
|
|
"atMobiles": atMobiles},
|
|
- "text": {"content": msg+"[趣程]"}}
|
|
|
|
|
|
+ "text": {"content": msg+"\n[趣程]"}}
|
|
|
|
|
|
requests.post(url=url, headers=headers, json=data)
|
|
requests.post(url=url, headers=headers, json=data)
|
|
|
|
|