From 62783135c55c525a23faaef94a9d2003cda1b5db Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Thu, 28 Apr 2022 15:08:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=AD=BE=E5=88=B0=E9=BB=91?= =?UTF-8?q?=E5=90=8D=E5=8D=95(config=20v5=E5=8A=9F=E8=83=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account.py | 4 ++-- genshin.py | 4 +++- honkai3rd.py | 2 ++ main.py | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/account.py b/account.py index 078c663..8453ea1 100644 --- a/account.py +++ b/account.py @@ -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() diff --git a/genshin.py b/genshin.py index fc4bb3c..a3e974d 100644 --- a/genshin.py +++ b/genshin.py @@ -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]) diff --git a/honkai3rd.py b/honkai3rd.py index 7543c63..cecfb4f 100644 --- a/honkai3rd.py +++ b/honkai3rd.py @@ -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) diff --git a/main.py b/main.py index d616b67..055c464 100644 --- a/main.py +++ b/main.py @@ -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()