MCPcopy Create free account
hub / github.com/Mashiro2000/HeyTapTask / main_handler

Function main_handler

Backup/BattleForHeyTap.py:257–276  ·  view source on GitHub ↗
(event, context)

Source from the content-addressed store, hash-verified

255
256# 兼容云函数
257def main_handler(event, context):
258 global lists
259 for each in lists:
260 if all(each.values()):
261 if checkHT(each):
262 battleForHeyTap = BattleForHeyTap(each)
263 for count in range(3):
264 try:
265 time.sleep(random.randint(2,5)) # 随机延时
266 battleForHeyTap.start()
267 break
268 except requests.exceptions.ConnectionError:
269 notify(f"{battleForHeyTap.dic['user']}\t请求失败,随机延迟后再次访问")
270 time.sleep(random.randint(2,5))
271 continue
272 else:
273 notify(f"账号: {battleForHeyTap.dic['user']}\n状态: 取消登录\n原因: 多次登录失败")
274 break
275 if not os.path.basename(__file__).split('_')[-1][:-3] in notifyBlackList:
276 send('欢太积分大乱斗',allMess)
277
278if __name__ == '__main__':
279 main_handler(None,None)

Callers 1

BattleForHeyTap.pyFile · 0.70

Calls 5

startMethod · 0.95
sendFunction · 0.90
BattleForHeyTapClass · 0.85
checkHTFunction · 0.70
notifyFunction · 0.70

Tested by

no test coverage detected