cwendt94 / espn-api

ESPN Fantasy API! (Football, Basketball)
MIT License
544 stars 183 forks source link

slot_position only returning "PG" #516

Open rjcote17 opened 6 months ago

rjcote17 commented 6 months ago

Sport

Basketball

Summary

I'm running into an issue where I use _slotposition and it only returns "PG." I don't quite understand why this is happening.

Logs/Data

Code:

box_scores = league.box_scores()
my_matchup = box_scores[4]
for player in my_matchup.home_lineup:
     print(player.name + ': ' + player.slot_position)

Output: CJ McCollum: PG Coby White: PG O.G. Anunoby: PG Cade Cunningham: PG Naz Reid: PG De'Anthony Melton: PG Chris Paul: PG Jaylen Brown: PG Cameron Johnson: PG Dennis Schroder: PG Giannis Antetokounmpo: PG Dante Exum: PG

rjcote17 commented 6 months ago

Never mind, I was able to resolve the problem by using lineupSlot. I don't quite understand what _slotposition is supposed to return, so I will leave this open in case I found an actual issue.

Code:

my_team = league.teams[1]
for player in my_team.roster:
    print(player.name + ': ' + str(player.lineupSlot))

Output: Giannis Antetokounmpo: BE Victor Wembanyama: IR De'Aaron Fox: UT Cade Cunningham: BE Jaylen Brown: F CJ McCollum: UT Chris Paul: BE O.G. Anunoby: SF Dennis Schroder: PG De'Anthony Melton: UT Cameron Johnson: PF Coby White: SG Dante Exum: G Naz Reid: C