for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
from lib.wechatutil.sendmessages import send_msg
from lib.wechatutil.wechatrequest import WechatRequest
from lib.wechatutil.message import TextMessage
class WechatClient(object):
def __init__(self, corpId, corpSecret):
self.connfactory = WechatRequest(corpId, corpSecret)
def sendTextMessage(self, agentid, content, **receivers):
msg = TextMessage()
msg.setagentid(agentid)
msg.setcontent(content)
msg.setreceiver(**receivers)
rc, msg = send_msg(msg, self.connfactory)
if rc != 0:
raise ValueError(msg)