获取API返回内容出错

我的主程序ro.py会将收到的消息进行拆解,将”/战绩 “后的值作为“Player_id”传递给zj.py,也会将zj.py收到的返回进行判断来发送对应的消息
我的需求是,当zj.py返回的值为1时发送“API接口已上限,请稍等1-2分钟后查询”,当返回值为2时发送“未找到该玩家信息,请核对玩家ID后重试”
但现在遇到个问题,为什么我即使是输入错误的ID,但是返回的值还是1?

ro.py

class MyClient(botpy.Client):
    async def on_group_at_message_create(self, message: GroupMessage):
        content = message.content.strip()
        if content.startswith("/战绩 "):
            player_id = content.split(" ")[1]
            print("Detected /战绩 message with player_id:", player_id)
            # await message._api.post_group_message(
            #     group_openid=message.group_openid,
            #     msg_type=0,
            #     msg_id=message.id,
            #     content="正在帮你查询中,请稍等~")
            result = subprocess.run([sys.executable, "zj.py", player_id], capture_output=True, text=True, encoding='utf-8')
            if result.returncode == 1:
                messageResult = await message._api.post_group_message(
                    group_openid=message.group_openid,
                    msg_type=0,
                    msg_id=message.id,
                    content="API接口已上限,请稍等1-2分钟后查询")
                _log.info(messageResult)
            elif result.returncode == 2:
                messageResult = await message._api.post_group_message(
                    group_openid=message.group_openid,
                    msg_type=0,
                    msg_id=message.id,
                    content="未找到该玩家信息,请核对玩家ID后重试")
                _log.info(messageResult)
            else:
                file_url = f"http://bot.6638.cf:443/{player_id}_stats.png"
                uploadMedia = await self.api.post_group_file(
                    group_openid=message.group_openid,
                    file_type=1,
                    url=file_url
                )
                await self.api.post_group_message(
                    group_openid=message.group_openid,
                    msg_type=7,  # 7表示富媒体类型
                    msg_id=message.id,
                    media=uploadMedia,
                    content=' ',
                )
                time.sleep(10)
                file_path = os.path.join(os.getcwd(), f"{player_id}_stats.png")
                if os.path.exists(file_path):
                    os.remove(file_path)

zj.py

def get_player_data(player_id):
    url = f"https://api.pubg.com/shards/steam/players?filter[playerNames]={player_id}"
    response = requests.get(url, headers=headers)
    if not response.text.strip():
        return 1
    elif "No Players Found Matching Criteria" in response.text:
        return 2
    data = response.json()
    ban_type = data['data'][0]['attributes']['banType'] if 'data' in data and data['data'] else None
    return data, ban_type
讨论数量: 1

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!