通知增加

This commit is contained in:
Womsxd 2022-04-25 16:07:37 +08:00
parent 4c52b8c590
commit 5ad6bc21c1
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
4 changed files with 12 additions and 3 deletions

View File

@ -86,7 +86,7 @@ def clear_cookies():
data["mihoyobbs_Login_ticket"] = ""
data["mihoyobbs_Stuid"] = ""
data["mihoyobbs_Stoken"] = ""
data["mihoyobbs_Cookies"] = ""
data["mihoyobbs_Cookies"] = "CookieError"
f.seek(0)
f.truncate()
temp_text = json.dumps(data, sort_keys=False, indent=4, separators=(', ', ': '))

View File

@ -81,6 +81,8 @@ def main():
else:
log.info("崩坏3签到功能未启用")
return 0, return_data
elif config.mihoyobbs_Cookies == "CookieError":
raise CookieError('Cookie expires')
else:
log.warning("Config未启用")
return 1, "Config未启用"

View File

@ -55,7 +55,12 @@ def main_multi(autorun: bool):
f'没执行{len(results["close"])}个,失败{len(results["error"])}' \
f'\r\n没执行的配置文件: {results["close"]}\r\n执行失败的配置文件: {results["error"]}'
log.info(push_message)
push.push(0, push_message)
status = 0
if len(results["error"]) == len(config_list):
status = 1
elif len(results["error"]) < len(config_list):
status = 2
push.push(status, push_message)
if __name__ == "__main__":

View File

@ -18,8 +18,10 @@ def load_config():
def title(status):
if status == 0:
return "「米游社脚本」执行成功!"
else:
elif status == 1:
return "「米游社脚本」执行失败!"
elif status == 2:
return "「米游社脚本」部分账号执行失败!"
# telegram的推送