支持签到黑名单(config v5功能)

This commit is contained in:
Womsxd 2022-04-28 15:08:27 +08:00
parent 4843eb77e9
commit 62783135c5
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
4 changed files with 9 additions and 5 deletions

View File

@ -18,12 +18,12 @@ def stop_module(game_id: str) -> None:
# 崩坏2功能敬请期待
pass
elif game_id == "bh3_cn":
config.config["games"]["cn"]["honkai3rd"] = False
config.config["games"]["cn"]["honkai3rd"]["auto_checkin"] = False
elif game_id == "nxx_cn":
# 未定好像没米游社签到
pass
elif game_id == "hk4e_cn":
config.config["games"]["cn"]["genshin"] = False
config.config["games"]["cn"]["genshin"]["auto_checkin"] = False
else:
raise NameError
config.save_config()

View File

@ -38,7 +38,7 @@ class Genshin:
if data["retcode"] != 0:
log.warning("获取账号签到信息失败!")
print(req.text)
config.config["games"]["cn"]["genshin"] = False
config.config["games"]["cn"]["genshin"]["auto_checkin"] = False
config.save_config()
raise CookieError("BBS Cookie Errror")
return data["data"]
@ -48,6 +48,8 @@ class Genshin:
return_data = "原神: "
if len(self.acc_List) != 0:
for i in self.acc_List:
if i[1] in config.config["games"]["cn"]["genshin"]["black_list"]:
continue
log.info(f"正在为旅行者{i[0]}进行签到...")
time.sleep(random.randint(2, 8))
is_data = self.is_sign(region=i[2], uid=i[1])

View File

@ -41,6 +41,8 @@ class Honkai3rd:
return_data += "\n并没有绑定任何崩坏3账号"
else:
for i in self.acc_List:
if i[1] in config.config["games"]["cn"]["honkai3rd"]["black_list"]:
continue
log.info(f"正在为舰长 {i[0]} 进行签到...")
req = http.get(setting.honkai3rd_Is_signurl.format(setting.honkai3rd_Act_id, i[2], i[1]),
headers=self.headers)

View File

@ -66,7 +66,7 @@ def main():
return_data += "\n" + "米游社功能未启用!"
log.info("米游社功能未启用!")
# 原神签到
if config.config["games"]["cn"]["genshin"]:
if config.config["games"]["cn"]["genshin"]["auto_checkin"]:
log.info("正在进行原神签到")
genshin_help = genshin.Genshin()
return_data += "\n\n" + genshin_help.sign_account()
@ -74,7 +74,7 @@ def main():
else:
log.info("原神签到功能未启用!")
# 崩坏3签到
if config.config["games"]["cn"]["honkai3rd"]:
if config.config["games"]["cn"]["honkai3rd"]["auto_checkin"]:
log.info("正在进行崩坏3签到")
honkai3rd_help = honkai3rd.Honkai3rd()
return_data += "\n\n" + honkai3rd_help.sign_account()