MCPcopy
hub / github.com/linbailo/zyqinglong / wecom_key

Function wecom_key

sendNotify.py:262–279  ·  view source on GitHub ↗
(title, content)

Source from the content-addressed store, hash-verified

260
261
262def wecom_key(title, content):
263 print("\n")
264 if not QYWX_KEY:
265 print("QYWX_KEY未设置!!\n取消推送")
266 return
267 print("QYWX_KEY服务启动")
268 print("content"+content)
269 headers = {'Content-Type': 'application/json'}
270 data = {
271 "msgtype":"text",
272 "text":{
273 "content":title+"\n"+content.replace("\n", "\n\n")
274 }
275 }
276
277 print(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}")
278 response = requests.post(f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={QYWX_KEY}", json=data,headers=headers).json()
279 print(response)
280
281# 飞书机器人推送
282def fs_key(title, content):

Callers 1

sendFunction · 0.85

Calls 1

postMethod · 0.45

Tested by

no test coverage detected