Skip to Content
VLRdevAPI

选手效力战队 (Player Teams)

获取选手的当前战队与过往战队经历,包含加入、离队以及进入非活跃状态的具体日期。

player.teams(player_id) 返回该选手在 vlr.gg 上的当前战队及历史效力战队列表。

函数签名

player.teams(player_id: int) -> PlayerTeams

参数

Prop

Type

返回值 - PlayerTeams

Prop

Type

PlayerTeam 字段说明

Prop

Type

示例

查询当前与过往战队

import vlrdevapi

teams = vlrdevapi.player.teams(player_id=438)

print("当前效力战队:")
for t in teams.current_teams:
    print(f"  {t.name} (自 {t.joined_date})")

print("历史效力战队:")
for t in teams.past_teams:
    end = t.left_date or t.inactive_date or "至今"
    print(f"  {t.name} ({t.joined_date} - {end})")

构建职业生涯战队时间线

import vlrdevapi
from datetime import datetime, timezone

teams = vlrdevapi.player.teams(player_id=438)
all_teams = teams.current_teams + teams.past_teams
for t in sorted(all_teams, key=lambda x: x.joined_date or datetime(1, 1, 1, tzinfo=timezone.utc)):
    print(f"{t.joined_date}: 加入 {t.name}")
    if t.left_date:
        print(f"{t.left_date}: 离开 {t.name}")

柯里化链式访问

import vlrdevapi

player = vlrdevapi.player(438)
teams = player.teams()
print(f"当前战队: {[t.name for t in teams.current_teams]}")

最后更新于

本页内容