MCPcopy
hub / github.com/ZainCheung/netease-cloud / wxpusher

Method wxpusher

index.py:106–123  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

104 Wxpusher推送
105 '''
106 def wxpusher(self):
107 if self.appToken == '' or self.wxpusheruid == '':
108 self.log('未填写WxPusher推送所需参数,请检查')
109 return
110 self.diyText() # 构造发送内容
111 url = 'https://wxpusher.zjiecode.com/api/send/message/'
112 data = json.dumps({
113 "appToken":self.appToken,
114 "content":self.content,
115 "summary":self.title,
116 "contentType":3,
117 "uids":[self.wxpusheruid]
118 })
119 response = requests.post(url, data = data, headers = {'Content-Type': 'application/json;charset=UTF-8'})
120 if (response.json()['data'][0]['status']) == '创建发送任务成功':
121 self.log('用户:' + self.name + ' WxPusher推送成功')
122 else:
123 self.log('用户:' + self.name + ' WxPusher推送失败,请检查appToken和uid是否正确')
124
125 '''
126 Bark推送

Callers 1

startMethod · 0.95

Calls 2

logMethod · 0.95
diyTextMethod · 0.95

Tested by

no test coverage detected