MCPcopy Create free account
hub / github.com/Mashiro2000/HeyTapTask / send_text

Method send_text

sendNotify.py:295–309  ·  view source on GitHub ↗
(self, message, touser="@all")

Source from the content-addressed store, hash-verified

293 return data["access_token"]
294
295 def send_text(self, message, touser="@all"):
296 send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token()
297 send_values = {
298 "touser": touser,
299 "msgtype": "text",
300 "agentid": self.AGENTID,
301 "text": {
302 "content": message
303 },
304 "safe": "0"
305 }
306 send_msges = (bytes(json.dumps(send_values), 'utf-8'))
307 respone = requests.post(send_url, send_msges)
308 respone = respone.json()
309 return respone["errmsg"]
310
311 def send_mpnews(self, title, message, media_id, touser="@all"):
312 send_url = 'https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=' + self.get_access_token()

Callers 1

wecom_appFunction · 0.95

Calls 1

get_access_tokenMethod · 0.95

Tested by

no test coverage detected