JanDeDobbeleer/oh-my-posh · warning

no scheduled game found for team

Error message

no scheduled game found for team

What it means

The NBA segment failed to find a game for the configured team tricode in a day's schedule list returned by the NBA broadcaster schedule endpoint. findGameSchedulebyTeamTricode scans CompleteGameList for a game whose visiting (vtAbbreviation) or home (htAbbreviation) abbreviation matches the team option; if none matches for that day it returns this sentinel error, which the caller treats as 'try the next day'. If it persists across all days, the schedule lookup ultimately fails and the segment hides.

Source

Thrown at src/segments/nba.go:166

func (nba *Nba) findGameScoreByTeamTricode(games []Game, teamTricode string) (*Game, error) {
	for _, game := range games {
		if game.HomeTeam.TeamTricode == teamTricode || game.AwayTeam.TeamTricode == teamTricode {
			return &game, nil
		}
	}

	return nil, errors.New("no game score found for team")
}

func (nba *Nba) findGameSchedulebyTeamTricode(games []ScheduledGame, teamTricode string) (*ScheduledGame, error) {
	for _, game := range games {
		if game.VtAbbreviation == teamTricode || game.HtAbbreviation == teamTricode {
			return &game, nil
		}
	}

	return nil, errors.New("no scheduled game found for team")
}

func (nba *Nba) parseTimetoUTC(timeEST, date string) string {
	combinedTime := date + " " + timeEST
	timeUTC, err := time.Parse("01/02/2006 03:04 PM", combinedTime)
	if err != nil {
		return ""
	}

	return timeUTC.UTC().Format("2006-01-02T15:04:05Z")
}

func (nba *Nba) retrieveScoreData(teamName string, httpTimeout int) (*NBAData, error) {
	body, err := nba.env.HTTPRequest(NBAScoreURL, nil, httpTimeout)
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to 0976794618)

Solutions

  1. Set the team option to the exact uppercase NBA tricode (e.g. "LAL", "BKN").
  2. Raise days_offset if the team plays within a few days (default window is 8 days).
  3. Verify the season option matches an active NBA season; stale seasons return empty schedules.
  4. Check that the tricode case matches — the comparison is case-sensitive.
  5. Confirm the game day is within the schedule window the endpoint returns.

Example fix

// before
"team": "lakers"
// after
"team": "LAL"
Defensive patterns

Strategy: validation

Validate before calling

const tricode = "LAL" // must be exact uppercase NBA tricode
if (!/^[A-Z]{2,3}$/.test(tricode)) {
  throw new Error(`team option must be an uppercase tricode, got: ${tricode}`)
}

Try / catch

try {
  game = findGameSchedulebyTeamTricode(games, tricode)
} catch (e) {
  if (e.message === "no scheduled game found for team") {
    // treat as "no game today", advance to next day or hide segment
  } else { throw e }
}

Prevention

When it happens

Trigger: Calling retrieveScheduleData with a team option whose tricode does not appear in the schedule for the queried date — e.g. the team did not play that day, or the tricode is wrong (LAL vs LA, BRO vs BKN) or lowercased ('lal' — comparison is case-sensitive exact match against the API's uppercase tricodes).

Common situations: NBA off-season or no-game days, mistyped/misspelled team abbreviations, using full team names instead of 3-letter tricodes, or the schedule endpoint payload shape changing so ResultSets[1] no longer holds the right list.

Related errors


AI-assisted analysis of JanDeDobbeleer/oh-my-posh@0976794618 (2026-08-31). Data as JSON: /api/errors/462e95cfc7e41dda. Report an issue: GitHub.