diff --git a/src/nonebot_plugin_mystool/api/common.py b/src/nonebot_plugin_mystool/api/common.py index f4ddd13d..218891a8 100644 --- a/src/nonebot_plugin_mystool/api/common.py +++ b/src/nonebot_plugin_mystool/api/common.py @@ -397,7 +397,7 @@ async def get_game_record(account: UserAccount, retry: bool = True) -> Tuple[Bas api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"获取用户游戏数据(GameRecord) - 用户 {account.bbs_uid} 登录失效") + f"获取用户游戏数据(GameRecord) - 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None return BaseApiStatus(success=True), list( @@ -455,7 +455,7 @@ async def get_user_myb(account: UserAccount, retry: bool = True) -> Tuple[BaseAp api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"获取用户米游币 - 用户 {account.bbs_uid} 登录失效") + f"获取用户米游币 - 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None return BaseApiStatus(success=True), int(api_result.data["points"]) @@ -497,7 +497,7 @@ async def device_login(account: UserAccount, retry: bool = True): api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"设备登录(device_login) - 用户 {account.bbs_uid} 登录失效") + f"设备登录(device_login) - 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True) if res.json()["message"] != "OK": @@ -542,7 +542,7 @@ async def device_save(account: UserAccount, retry: bool = True): api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"设备保存(device_save) - 用户 {account.bbs_uid} 登录失效") + f"设备保存(device_save) - 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True) if res.json()["message"] != "OK": @@ -679,7 +679,7 @@ async def get_address(account: UserAccount, retry: bool = True) -> Tuple[BaseApi api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"获取地址数据 - 用户 {account.bbs_uid} 登录失效") + f"获取地址数据 - 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None address_list = list(map(Address.parse_obj, api_result.data["list"])) @@ -1362,28 +1362,28 @@ async def good_exchange(plan: ExchangePlan) -> Tuple[ExchangeStatus, Optional[Ex api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"米游币商品兑换 - 执行兑换: 用户 {plan.account.bbs_uid} 登录失效 - 请求发送时间: {start_time}") + f"米游币商品兑换 - 执行兑换: 用户 {plan.account.display_name} 登录失效 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(login_expired=True), None if api_result.success: logger.info( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 兑换成功!可以自行确认 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 兑换成功!可以自行确认 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(success=True), ExchangeResult(result=True, return_data=res.json(), plan=plan) else: logger.info( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 兑换失败,可以自行确认 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 兑换失败,可以自行确认 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(success=True), ExchangeResult(result=False, return_data=res.json(), plan=plan) except Exception as e: if is_incorrect_return(e): logger.error( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 服务器没有正确返回 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 服务器没有正确返回 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(incorrect_return=True), None else: logger.exception( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 请求失败 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 请求失败 - 请求发送时间: {start_time}") return ExchangeStatus(network_error=True), None @@ -1421,28 +1421,28 @@ def good_exchange_sync(plan: ExchangePlan) -> Tuple[ExchangeStatus, Optional[Exc api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"米游币商品兑换 - 执行兑换: 用户 {plan.account.bbs_uid} 登录失效 - 请求发送时间: {start_time}") + f"米游币商品兑换 - 执行兑换: 用户 {plan.account.display_name} 登录失效 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(login_expired=True), None if api_result.success: logger.info( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 兑换成功!可以自行确认 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 兑换成功!可以自行确认 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(success=True), ExchangeResult(result=True, return_data=res.json(), plan=plan) else: logger.info( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 兑换失败,可以自行确认 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 兑换失败,可以自行确认 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(success=True), ExchangeResult(result=False, return_data=res.json(), plan=plan) except Exception as e: if is_incorrect_return(e): logger.error( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 服务器没有正确返回 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 服务器没有正确返回 - 请求发送时间: {start_time}") logger.debug(f"网络请求返回: {res.text}") return ExchangeStatus(incorrect_return=True), None else: logger.exception( - f"米游币商品兑换: 用户 {plan.account.bbs_uid} 商品 {plan.good.goods_id} 请求失败 - 请求发送时间: {start_time}") + f"米游币商品兑换: 用户 {plan.account.display_name} 商品 {plan.good.goods_id} 请求失败 - 请求发送时间: {start_time}") return ExchangeStatus(network_error=True), None @@ -1491,17 +1491,17 @@ async def genshin_note(account: UserAccount) -> Tuple[ api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"原神实时便笺: 用户 {account.bbs_uid} 登录失效") + f"原神实时便笺: 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return GenshinNoteStatus(login_expired=True), None if api_result.invalid_ds: logger.info( - f"原神实时便笺: 用户 {account.bbs_uid} DS 校验失败") + f"原神实时便笺: 用户 {account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") if api_result.retcode == 1034: logger.info( - f"原神实时便笺: 用户 {account.bbs_uid} 可能被验证码阻拦") + f"原神实时便笺: 用户 {account.display_name} 可能被验证码阻拦") logger.debug(f"网络请求返回: {res.text}") if not api_result.success: headers["DS"] = generate_ds() @@ -1568,17 +1568,17 @@ async def starrail_note(account: UserAccount) -> Tuple[ api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"崩铁实时便笺: 用户 {account.bbs_uid} 登录失效") + f"崩铁实时便笺: 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return StarRailNoteStatus(login_expired=True), None if api_result.invalid_ds: logger.info( - f"崩铁实时便笺: 用户 {account.bbs_uid} DS 校验失败") + f"崩铁实时便笺: 用户 {account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") if api_result.retcode == 1034: logger.info( - f"崩铁实时便笺: 用户 {account.bbs_uid} 可能被验证码阻拦") + f"崩铁实时便笺: 用户 {account.display_name} 可能被验证码阻拦") logger.debug(f"网络请求返回: {res.text}") return StarRailNoteStatus(success=True), StarRailNote.parse_obj(api_result.data) except tenacity.RetryError as e: diff --git a/src/nonebot_plugin_mystool/api/game_sign_api.py b/src/nonebot_plugin_mystool/api/game_sign_api.py index 834e3fb0..f3c5771c 100644 --- a/src/nonebot_plugin_mystool/api/game_sign_api.py +++ b/src/nonebot_plugin_mystool/api/game_sign_api.py @@ -115,12 +115,12 @@ async def get_info( api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"获取签到数据 - 用户 {self.account.bbs_uid} 登录失效") + f"获取签到数据 - 用户 {self.account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None if api_result.invalid_ds: logger.info( - f"获取签到数据 - 用户 {self.account.bbs_uid} DS 校验失败") + f"获取签到数据 - 用户 {self.account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(invalid_ds=True), None return BaseApiStatus(success=True), GameSignInfo.parse_obj(api_result.data) @@ -193,21 +193,21 @@ async def sign(self, api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"游戏签到 - 用户 {self.account.bbs_uid} 登录失效") + f"游戏签到 - 用户 {self.account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None elif api_result.invalid_ds: logger.info( - f"游戏签到 - 用户 {self.account.bbs_uid} DS 校验失败") + f"游戏签到 - 用户 {self.account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(invalid_ds=True), None elif api_result.data.get("risk_code") != 0: logger.warning( - f"{plugin_config.preference.log_head}游戏签到 - 用户 {self.account.bbs_uid} 可能被人机验证阻拦") + f"{plugin_config.preference.log_head}游戏签到 - 用户 {self.account.display_name} 可能被人机验证阻拦") logger.debug(f"{plugin_config.preference.log_head}网络请求返回: {res.text}") return BaseApiStatus(need_verify=True), MmtData.parse_obj(api_result.data) else: - logger.success(f"游戏签到 - 用户 {self.account.bbs_uid} 签到成功") + logger.success(f"游戏签到 - 用户 {self.account.display_name} 签到成功") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(success=True), None diff --git a/src/nonebot_plugin_mystool/api/myb_missions_api.py b/src/nonebot_plugin_mystool/api/myb_missions_api.py index deebe5f1..db90b8d2 100644 --- a/src/nonebot_plugin_mystool/api/myb_missions_api.py +++ b/src/nonebot_plugin_mystool/api/myb_missions_api.py @@ -134,17 +134,17 @@ async def sign(self, retry: bool = True) -> Tuple[MissionStatus, Optional[int]]: api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.error( - f"米游币任务 - 讨论区签到: 用户 {self.account.bbs_uid} 登录失效") + f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(login_expired=True), None elif api_result.invalid_ds: logger.error( - f"米游币任务 - 讨论区签到: 用户 {self.account.bbs_uid} DS 校验失败") + f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(invalid_ds=True), None elif api_result.retcode == 1034: logger.error( - f"米游币任务 - 讨论区签到: 用户 {self.account.bbs_uid} 需要完成人机验证") + f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 需要完成人机验证") logger.debug(f"网络请求返回: {res.text}") if plugin_config.preference.geetest_url: create_status, mmt_data = await create_verification(self.account) @@ -152,15 +152,15 @@ async def sign(self, retry: bool = True) -> Tuple[MissionStatus, Optional[int]]: if geetest_result := await get_validate(mmt_data.gt, mmt_data.challenge): if await verify_verification(mmt_data, geetest_result, self.account): logger.success( - f"米游币任务 - 讨论区签到: 用户 {self.account.bbs_uid} 人机验证通过") + f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 人机验证通过") continue else: logger.info( - f"米游币任务 - 讨论区签到: 用户 {self.account.bbs_uid} 未配置极验人机验证打码平台") + f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 未配置极验人机验证打码平台") return MissionStatus(need_verify=True), None elif api_result.retcode == 1008: logger.warning( - f"米游币任务 - 讨论区签到: 用户 {self.account.bbs_uid} 今日已经签到过了") + f"米游币任务 - 讨论区签到: 用户 {self.account.display_name} 今日已经签到过了") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(success=True, already_signed=True), 0 return MissionStatus(success=True), api_result.data["points"] @@ -236,12 +236,12 @@ async def read(self, read_times: int = 5, retry: bool = True) -> MissionStatus: api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"米游币任务 - 阅读: 用户 {self.account.bbs_uid} 登录失效") + f"米游币任务 - 阅读: 用户 {self.account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(login_expired=True) if api_result.invalid_ds: logger.info( - f"米游币任务 - 阅读: 用户 {self.account.bbs_uid} DS 校验失败") + f"米游币任务 - 阅读: 用户 {self.account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(invalid_ds=True) if api_result.message == "帖子不存在": @@ -297,12 +297,12 @@ async def like(self, like_times: int = 10, retry: bool = True) -> MissionStatus: api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"米游币任务 - 点赞: 用户 {self.account.bbs_uid} 登录失效") + f"米游币任务 - 点赞: 用户 {self.account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(login_expired=True) if api_result.invalid_ds: logger.info( - f"米游币任务 - 点赞: 用户 {self.account.bbs_uid} DS 校验失败") + f"米游币任务 - 点赞: 用户 {self.account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(invalid_ds=True) if api_result.message == "帖子不存在": @@ -351,12 +351,12 @@ async def share(self, retry: bool = True): api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"米游币任务 - 分享: 用户 {self.account.bbs_uid} 登录失效") + f"米游币任务 - 分享: 用户 {self.account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(login_expired=True) if api_result.invalid_ds: logger.info( - f"米游币任务 - 分享: 用户 {self.account.bbs_uid} DS 校验失败") + f"米游币任务 - 分享: 用户 {self.account.display_name} DS 校验失败") logger.debug(f"网络请求返回: {res.text}") return MissionStatus(invalid_ds=True) if api_result.message == "帖子不存在": @@ -466,7 +466,7 @@ async def get_missions(account: UserAccount, retry: bool = True) -> Tuple[BaseAp api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"获取米游币任务列表: 用户 {account.bbs_uid} 登录失效") + f"获取米游币任务列表: 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None mission_list: List[MissionData] = [] @@ -503,7 +503,7 @@ async def get_missions_state(account: UserAccount, retry: bool = True) -> Tuple[ api_result = ApiResultHandler(res.json()) if api_result.login_expired: logger.info( - f"获取米游币任务完成情况: 用户 {account.bbs_uid} 登录失效") + f"获取米游币任务完成情况: 用户 {account.display_name} 登录失效") logger.debug(f"网络请求返回: {res.text}") return BaseApiStatus(login_expired=True), None state_dict = {} diff --git a/src/nonebot_plugin_mystool/command/address.py b/src/nonebot_plugin_mystool/command/address.py index d701dadf..1b44406c 100644 --- a/src/nonebot_plugin_mystool/command/address.py +++ b/src/nonebot_plugin_mystool/command/address.py @@ -63,7 +63,7 @@ async def _(event: Union[GeneralPrivateMessageEvent], state: T_State, bbs_uid=Ar state['address_list'] = address_list if not address_status: if address_status.login_expired: - await address_matcher.finish(f"⚠️账户 {account.bbs_uid} 登录失效,请重新登录") + await address_matcher.finish(f"⚠️账户 {account.display_name} 登录失效,请重新登录") await address_matcher.finish("⚠️获取失败,请稍后重新尝试") if address_list: @@ -96,6 +96,6 @@ async def _(_: Union[GeneralPrivateMessageEvent], state: T_State, address_id=Arg account: UserAccount = state["account"] account.address = address PluginDataManager.write_plugin_data() - await address_matcher.finish(f"🎉已成功设置账户 {account.bbs_uid} 的地址") + await address_matcher.finish(f"🎉已成功设置账户 {account.display_name} 的地址") else: await address_matcher.reject("⚠️您发送的地址ID与查询结果不匹配,请重新发送") diff --git a/src/nonebot_plugin_mystool/command/exchange.py b/src/nonebot_plugin_mystool/command/exchange.py index 21e515c7..6027a2ef 100644 --- a/src/nonebot_plugin_mystool/command/exchange.py +++ b/src/nonebot_plugin_mystool/command/exchange.py @@ -122,7 +122,7 @@ async def _( f"\n- 🔢商品ID:{good.goods_id}" \ f"\n- 💰商品价格:{good.price} 米游币" \ f"\n- 📅兑换时间:{good.time_text}" \ - f"\n- 🆔账户:{plan.account.bbs_uid}" + f"\n- 🆔账户:{plan.account.display_name}" msg += "\n\n" if not msg: msg = '您还没有兑换计划哦~\n\n' @@ -264,7 +264,7 @@ async def _( else: user.exchange_plans.add(plan) if not plan.account.device_fp: - logger.info(f"账号 {plan.account.bbs_uid} 未设置 device_fp,正在获取...") + logger.info(f"账号 {plan.account.display_name} 未设置 device_fp,正在获取...") fp_status, plan.account.device_fp = await get_device_fp(plan.account.device_id_ios) if not fp_status: await matcher.send( @@ -385,7 +385,7 @@ def exchange_notice(event: JobExecutionEvent): loop.create_task( send_private_msg( user_id=_user_id, - message=f"⚠️账户 {plan.account.bbs_uid}" + message=f"⚠️账户 {plan.account.display_name}" f"\n- {plan.good.general_name}" f"\n- 线程 {thread_id}" f"\n- 兑换请求发送失败" @@ -409,7 +409,7 @@ def exchange_notice(event: JobExecutionEvent): loop.create_task( send_private_msg( user_id=_user_id, - message=f"🎉账户 {plan.account.bbs_uid}" + message=f"🎉账户 {plan.account.display_name}" f"\n- {plan.good.general_name}" f"\n- 线程 {thread_id}" f"\n- 兑换成功" @@ -421,7 +421,7 @@ def exchange_notice(event: JobExecutionEvent): loop.create_task( send_private_msg( user_id=_user_id, - message=f"💦账户 {plan.account.bbs_uid}" + message=f"💦账户 {plan.account.display_name}" f"\n- {plan.good.general_name}" f"\n- 线程 {thread_id}" f"\n- 兑换失败" diff --git a/src/nonebot_plugin_mystool/command/plan.py b/src/nonebot_plugin_mystool/command/plan.py index e927d816..3bd4925c 100644 --- a/src/nonebot_plugin_mystool/command/plan.py +++ b/src/nonebot_plugin_mystool/command/plan.py @@ -227,12 +227,12 @@ async def perform_game_sign( game_record_status, records = await get_game_record(account) if not game_record_status: if matcher: - await matcher.send(f"⚠️账户 {account.bbs_uid} 获取游戏账号信息失败,请重新尝试") + await matcher.send(f"⚠️账户 {account.display_name} 获取游戏账号信息失败,请重新尝试") else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f"⚠️账户 {account.bbs_uid} 获取游戏账号信息失败,请重新尝试" + message=f"⚠️账户 {account.display_name} 获取游戏账号信息失败,请重新尝试" ) continue games_has_record = [] @@ -245,12 +245,12 @@ async def perform_game_sign( get_info_status, info = await signer.get_info(account.platform) if not get_info_status: if matcher: - await matcher.send(f"⚠️账户 {account.bbs_uid} 获取签到记录失败") + await matcher.send(f"⚠️账户 {account.display_name} 获取签到记录失败") else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f"⚠️账户 {account.bbs_uid} 获取签到记录失败" + message=f"⚠️账户 {account.display_name} 获取签到记录失败" ) else: signed = info.is_sign @@ -267,12 +267,12 @@ async def perform_game_sign( if not sign_status and (user.enable_notice or matcher): if sign_status.login_expired: - message = f"⚠️账户 {account.bbs_uid} 🎮『{signer.name}』签到时服务器返回登录失效,请尝试重新登录绑定账户" + message = f"⚠️账户 {account.display_name} 🎮『{signer.name}』签到时服务器返回登录失效,请尝试重新登录绑定账户" elif sign_status.need_verify: - message = (f"⚠️账户 {account.bbs_uid} 🎮『{signer.name}』签到时可能遇到验证码拦截," + message = (f"⚠️账户 {account.display_name} 🎮『{signer.name}』签到时可能遇到验证码拦截," "请尝试使用命令『/账号设置』更改设备平台,若仍失败请手动前往米游社签到") else: - message = f"⚠️账户 {account.bbs_uid} 🎮『{signer.name}』签到失败,请稍后再试" + message = f"⚠️账户 {account.display_name} 🎮『{signer.name}』签到失败,请稍后再试" if matcher: await matcher.send(message) elif user.enable_notice: @@ -289,12 +289,12 @@ async def perform_game_sign( get_info_status, info = await signer.get_info(account.platform) get_award_status, awards = await signer.get_rewards() if not get_info_status or not get_award_status: - msg = f"⚠️账户 {account.bbs_uid} 🎮『{signer.name}』获取签到结果失败!请手动前往米游社查看" + msg = f"⚠️账户 {account.display_name} 🎮『{signer.name}』获取签到结果失败!请手动前往米游社查看" else: award = awards[info.total_sign_day - 1] if info.is_sign: status = "签到成功!" if not signed else "已经签到过了" - msg = f"🪪账户 {account.bbs_uid}" \ + msg = f"🪪账户 {account.display_name}" \ f"\n🎮『{signer.name}』" \ f"\n🎮状态: {status}" \ f"\n{signer.record.nickname}·{signer.record.level}" \ @@ -305,7 +305,7 @@ async def perform_game_sign( onebot_img_msg = OneBotV11MessageSegment.image(img_file) qq_guild_img_msg = QQGuildMessageSegment.file_image(img_file) else: - msg = (f"⚠️账户 {account.bbs_uid} 🎮『{signer.name}』签到失败!请尝试重新签到," + msg = (f"⚠️账户 {account.display_name} 🎮『{signer.name}』签到失败!请尝试重新签到," "若多次失败请尝试重新登录绑定账户") if matcher: try: @@ -329,12 +329,12 @@ async def perform_game_sign( if not games_has_record: if matcher: - await matcher.send(f"⚠️您的米游社账户 {account.bbs_uid} 下不存在任何游戏账号,已跳过签到") + await matcher.send(f"⚠️您的米游社账户 {account.display_name} 下不存在任何游戏账号,已跳过签到") else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f"⚠️您的米游社账户 {account.bbs_uid} 下不存在任何游戏账号,已跳过签到" + message=f"⚠️您的米游社账户 {account.display_name} 下不存在任何游戏账号,已跳过签到" ) # 如果全部登录失效,则关闭通知 @@ -361,20 +361,20 @@ async def perform_bbs_sign(user: UserData, user_ids: Iterable[str], matcher: Mat if not missions_state_status: if missions_state_status.login_expired: if matcher: - await matcher.send(f'⚠️账户 {account.bbs_uid} 登录失效,请重新登录') + await matcher.send(f'⚠️账户 {account.display_name} 登录失效,请重新登录') else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f'⚠️账户 {account.bbs_uid} 登录失效,请重新登录' + message=f'⚠️账户 {account.display_name} 登录失效,请重新登录' ) if matcher: - await matcher.send(f'⚠️账户 {account.bbs_uid} 获取任务完成情况请求失败,你可以手动前往App查看') + await matcher.send(f'⚠️账户 {account.display_name} 获取任务完成情况请求失败,你可以手动前往App查看') else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f'⚠️账户 {account.bbs_uid} 获取任务完成情况请求失败,你可以手动前往App查看' + message=f'⚠️账户 {account.display_name} 获取任务完成情况请求失败,你可以手动前往App查看' ) continue myb_before_mission = missions_state.current_myb @@ -387,11 +387,11 @@ async def perform_bbs_sign(user: UserData, user_ids: Iterable[str], matcher: Mat if not class_type: if matcher: await matcher.send( - f'⚠️🆔账户 {account.bbs_uid} 米游币任务目标分区『{class_name}』未找到,将跳过该分区') + f'⚠️🆔账户 {account.display_name} 米游币任务目标分区『{class_name}』未找到,将跳过该分区') continue mission_obj = class_type(account) if matcher: - await matcher.send(f'🆔账户 {account.bbs_uid} ⏳开始在分区『{class_type.name}』执行米游币任务...') + await matcher.send(f'🆔账户 {account.display_name} ⏳开始在分区『{class_type.name}』执行米游币任务...') # 执行任务 sign_status, read_status, like_status, share_status = ( @@ -413,7 +413,7 @@ async def perform_bbs_sign(user: UserData, user_ids: Iterable[str], matcher: Mat if matcher: await matcher.send( - f"🆔账户 {account.bbs_uid} 🎮『{class_type.name}』米游币任务执行情况:\n" + f"🆔账户 {account.display_name} 🎮『{class_type.name}』米游币任务执行情况:\n" f"📅签到:{'✓' if sign_status else '✕'} +{sign_points or '0'} 米游币🪙\n" f"📰阅读:{'✓' if read_status else '✕'}\n" f"❤️点赞:{'✓' if like_status else '✕'}\n" @@ -426,22 +426,22 @@ async def perform_bbs_sign(user: UserData, user_ids: Iterable[str], matcher: Mat if not missions_state_status: if missions_state_status.login_expired: if matcher: - await matcher.send(f'⚠️账户 {account.bbs_uid} 登录失效,请重新登录') + await matcher.send(f'⚠️账户 {account.display_name} 登录失效,请重新登录') else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f'⚠️账户 {account.bbs_uid} 登录失效,请重新登录' + message=f'⚠️账户 {account.display_name} 登录失效,请重新登录' ) continue if matcher: await matcher.send( - f'⚠️账户 {account.bbs_uid} 获取任务完成情况请求失败,你可以手动前往App查看') + f'⚠️账户 {account.display_name} 获取任务完成情况请求失败,你可以手动前往App查看') else: for user_id in user_ids: await send_private_msg( user_id=user_id, - message=f'⚠️账户 {account.bbs_uid} 获取任务完成情况请求失败,你可以手动前往App查看' + message=f'⚠️账户 {account.display_name} 获取任务完成情况请求失败,你可以手动前往App查看' ) continue if all(current == mission.threshold for mission, current in missions_state.state_dict.values()): @@ -450,7 +450,7 @@ async def perform_bbs_sign(user: UserData, user_ids: Iterable[str], matcher: Mat notice_string = "⚠️今日米游币任务未全部完成" msg = f"{notice_string}" \ - f"\n🆔账户 {account.bbs_uid}" + f"\n🆔账户 {account.display_name}" for key_name, (mission, current) in missions_state.state_dict.items(): if key_name == BaseMission.SIGN: mission_name = "📅签到" @@ -494,12 +494,12 @@ async def genshin_note_check(user: UserData, user_ids: Iterable[str], matcher: M if not genshin_board_status: if matcher: if genshin_board_status.login_expired: - await matcher.send(f'⚠️账户 {account.bbs_uid} 登录失效,请重新登录') + await matcher.send(f'⚠️账户 {account.display_name} 登录失效,请重新登录') elif genshin_board_status.no_genshin_account: - await matcher.send(f'⚠️账户 {account.bbs_uid} 没有绑定任何原神账户,请绑定后再重试') + await matcher.send(f'⚠️账户 {account.display_name} 没有绑定任何原神账户,请绑定后再重试') elif genshin_board_status.need_verify: - await matcher.send(f'⚠️账户 {account.bbs_uid} 获取实时便笺时被人机验证阻拦') - await matcher.send(f'⚠️账户 {account.bbs_uid} 获取实时便笺请求失败,你可以手动前往App查看') + await matcher.send(f'⚠️账户 {account.display_name} 获取实时便笺时被人机验证阻拦') + await matcher.send(f'⚠️账户 {account.display_name} 获取实时便笺请求失败,你可以手动前往App查看') continue msg = '' @@ -551,7 +551,7 @@ async def genshin_note_check(user: UserData, user_ids: Iterable[str], matcher: M return msg += "❖原神·实时便笺❖" \ - f"\n🆔账户 {account.bbs_uid}" \ + f"\n🆔账户 {account.display_name}" \ f"\n⏳树脂数量:{note.current_resin} / 160" \ f"\n⏱️树脂{note.resin_recovery_text}" \ f"\n🕰️探索派遣:{note.current_expedition_num} / {note.max_expedition_num}" \ @@ -581,12 +581,12 @@ async def starrail_note_check(user: UserData, user_ids: Iterable[str], matcher: if not starrail_board_status: if matcher: if starrail_board_status.login_expired: - await matcher.send(f'⚠️账户 {account.bbs_uid} 登录失效,请重新登录') + await matcher.send(f'⚠️账户 {account.display_name} 登录失效,请重新登录') elif starrail_board_status.no_starrail_account: - await matcher.send(f'⚠️账户 {account.bbs_uid} 没有绑定任何星铁账户,请绑定后再重试') + await matcher.send(f'⚠️账户 {account.display_name} 没有绑定任何星铁账户,请绑定后再重试') elif starrail_board_status.need_verify: - await matcher.send(f'⚠️账户 {account.bbs_uid} 获取实时便笺时被人机验证阻拦') - await matcher.send(f'⚠️账户 {account.bbs_uid} 获取实时便笺请求失败,你可以手动前往App查看') + await matcher.send(f'⚠️账户 {account.display_name} 获取实时便笺时被人机验证阻拦') + await matcher.send(f'⚠️账户 {account.display_name} 获取实时便笺请求失败,你可以手动前往App查看') continue msg = '' @@ -638,7 +638,7 @@ async def starrail_note_check(user: UserData, user_ids: Iterable[str], matcher: return msg += "❖星穹铁道·实时便笺❖" \ - f"\n🆔账户 {account.bbs_uid}" \ + f"\n🆔账户 {account.display_name}" \ f"\n⏳开拓力数量:{note.current_stamina} / {note.max_stamina}" \ f"\n⏱开拓力{note.stamina_recover_text}" \ f"\n📒每日实训:{note.current_train_score} / {note.max_train_score}" \