Aller au contenu principal

NBA

Traduction Bêta Non Officielle

Cette page a été traduite par PageTurner AI (bêta). Non approuvée officiellement par le projet. Vous avez trouvé une erreur ? Signaler un problème →

Description

Le segment NBA vous permet d'afficher les horaires et les scores de votre équipe NBA préférée !

Exemple de configuration

Pour utiliser le segment NBA, vous devez fournir un tri-code valide correspondant à l'équipe pour laquelle vous souhaitez obtenir des données dans la configuration. Par exemple, pour obtenir les informations des Los Angeles Lakers, vous devrez utiliser le tri-code « LAL ».

Cet exemple utilise « LAL » pour récupérer les informations des Los Angeles Lakers. Il définit également les couleurs de premier plan et d'arrière-plan pour correspondre à la charte graphique de l'équipe. Si vous souhaitez connaître les combinaisons de couleurs utilisables pour d'autres équipes, vous pouvez explorer différents schémas colorimétriques ici.

Il est recommandé de définir un délai d'expiration HTTP plus élevé que la valeur par défaut normale, au cas où la récupération des informations du tableau des scores prendrait un certain temps. Dans cet exemple, le http_timeout est défini sur 1500.

{
"background": "#e9ac2f",
"foreground": "#8748dc",
"leading_diamond": "",
"style": "diamond",
"trailing_diamond": "",
"type": "nba",
"options": {
"team": "LAL",
"http_timeout": 1500
}
}

Options

NameTypeDefaultDescription
teamstringtri-code for the NBA team you want to get data for
days_offsetint8how many days in advance you wish to see that information for
http_timeoutint20How long do you want to wait before you want to see your prompt more than your sugar? I figure a half second is a good default

Modèle (info)

modèle par défaut
 \udb82\udc06 {{ .HomeTeam}}{{ if .HasStats }} ({{.HomeTeamWins}}-{{.HomeTeamLosses}}){{ end }}{{ if .Started }}:{{.HomeScore}}{{ end }} vs {{ .AwayTeam}}{{ if .HasStats }} ({{.AwayTeamWins}}-{{.AwayTeamLosses}}){{ end }}{{ if .Started }}:{{.AwayScore}}{{ end }} | {{ if not .Started }}{{.GameDate}} | {{ end }}{{.Time}}

Propriétés

NameTypeDescription
.HomeTeamstringhome team for the upcoming game
.AwayTeamstringaway team for the upcoming game
.Timestringtime (EST) that the upcoming game will start
.GameDatestringdate the game will happen
.StartTimeUTCstringtime (UTC) the game will start
.GameStatusintegerinteger, 1 = scheduled, 2 = in progress, 3 = finished
.HomeScoreintscore of the home team
.AwayScoreintscore of the away team
.HomeTeamWinsintnumber of wins the home team currently has for the season
.HomeTeamLossesintnumber of losses the home team currently has for the season
.AwayTeamWinsintnumber of wins the away team currently has for the season
.AwayTeamLossesintnumber of losses the away team currently has for the season
.Startedbooleanif the game was started or not
.HasStatsbooleanif the game has game stats or not