MCPcopy Create free account
hub / github.com/ZainCheung/netease-cloud / server

Method server

main.py:171–192  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

169 Server推送
170 '''
171 def server(self):
172 if self.sckey == '':
173 return
174 self.diyText() # 构造发送内容
175 data = {
176 "text":self.title,
177 "desp":self.content
178 }
179 if (self.pushmethod.lower() == 'scturbo'): #Server酱 Turbo版
180 url = 'https://sctapi.ftqq.com/' + self.sckey + '.send'
181 response = requests.post(url, data=data, headers = {'Content-type': 'application/x-www-form-urlencoded'})
182 errno = response.json()['data']['errno']
183 else: #Server酱 普通版
184 url = 'http://sc.ftqq.com/' + self.sckey + '.send'
185 response = requests.post(url, data=data, headers = {'Content-type': 'application/x-www-form-urlencoded'})
186 errno = response.json()['errno']
187 if errno == 0:
188 self.log('用户:' + self.name + ' Server酱推送成功')
189 logging.info('用户:' + self.name + ' Server酱推送成功')
190 else:
191 self.log('用户:' + self.name + ' Server酱推送失败,请检查sckey是否正确')
192 logging.info('用户:' + self.name + ' Server酱推送失败,请检查sckey是否正确')
193
194 '''
195 自定义要推送到微信的内容

Callers 1

startMethod · 0.95

Calls 2

diyTextMethod · 0.95
logMethod · 0.95

Tested by

no test coverage detected