Total Complexity | 3 |
Total Lines | 12 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | from lib.wechatutil.sendmessages import send_msg |
||
6 | class WechatClient(object): |
||
7 | def __init__(self, corpId, corpSecret): |
||
8 | self.connfactory = WechatRequest(corpId, corpSecret) |
||
9 | |||
10 | def sendTextMessage(self, agentid, content, **receivers): |
||
11 | msg = TextMessage() |
||
12 | msg.setagentid(agentid) |
||
13 | msg.setcontent(content) |
||
14 | msg.setreceiver(**receivers) |
||
15 | rc, msg = send_msg(msg, self.connfactory) |
||
16 | if rc != 0: |
||
17 | raise ValueError(msg) |
||
18 |