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

Method bark

index.py:128–144  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

126 Bark推送
127 '''
128 def bark(self):
129 if self.barkServer == '' or self.barkKey == '':
130 self.log('未填写Bark推送所需参数,请检查')
131 return
132 self.diyText() # 构造发送内容
133 url = self.barkServer+'/push'
134 data = json.dumps({
135 "title": self.title,
136 "body": self.content,
137 "device_key": self.barkKey,
138 "ext_params": {"group": "网易云签到"}
139 })
140 response = requests.post(url, data=data, headers={'Content-Type': 'application/json;charset=UTF-8'})
141 if (response.json()['message']) == 'success':
142 self.log('用户:' + self.name + ' Bark推送成功')
143 else:
144 self.log('用户:' + self.name + ' bark推送失败,请检查appToken和uid是否正确')
145
146 '''
147 自定义要推送到微信的内容

Callers 1

startMethod · 0.95

Calls 2

logMethod · 0.95
diyTextMethod · 0.95

Tested by

no test coverage detected