NBA
非官方测试版翻译
本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →
功能
NBA 片段可以显示你最喜欢的 NBA 球队赛程和比分信息!
示例配置
要使用 NBA 片段,你需要在配置中提供有效的球队三字母代码。例如,若要获取洛杉矶湖人队的信息,需使用 "LAL" 三字母代码。
此示例使用 "LAL" 获取洛杉矶湖人队信息,同时设置前景色和背景色以匹配球队主题风格。如需了解其他球队适用的配色方案,可在此处查看相关配色方案。
建议将 HTTP 超时设为高于默认值,以防获取比分信息耗时较长。此示例将 http_timeout 设为 1500。
- json
- yaml
- toml
{
"background": "#e9ac2f",
"foreground": "#8748dc",
"leading_diamond": "",
"style": "diamond",
"trailing_diamond": "",
"type": "nba",
"options": {
"team": "LAL",
"http_timeout": 1500
}
}
background: "#e9ac2f"
foreground: "#8748dc"
leading_diamond:
style: diamond
trailing_diamond:
type: nba
options:
team: LAL
http_timeout: 1500
background = "#e9ac2f"
foreground = "#8748dc"
leading_diamond = ""
style = "diamond"
trailing_diamond = ""
type = "nba"
[options]
team = "LAL"
http_timeout = 1500
选项
| Name | Type | Default | Description |
|---|---|---|---|
team | string | tri-code for the NBA team you want to get data for | |
days_offset | int | 8 | how many days in advance you wish to see that information for |
http_timeout | int | 20 | How 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 |
模板 (信息)
默认模板
\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}}
属性
| Name | Type | Description |
|---|---|---|
.HomeTeam | string | home team for the upcoming game |
.AwayTeam | string | away team for the upcoming game |
.Time | string | time (EST) that the upcoming game will start |
.GameDate | string | date the game will happen |
.StartTimeUTC | string | time (UTC) the game will start |
.GameStatus | integer | integer, 1 = scheduled, 2 = in progress, 3 = finished |
.HomeScore | int | score of the home team |
.AwayScore | int | score of the away team |
.HomeTeamWins | int | number of wins the home team currently has for the season |
.HomeTeamLosses | int | number of losses the home team currently has for the season |
.AwayTeamWins | int | number of wins the away team currently has for the season |
.AwayTeamLosses | int | number of losses the away team currently has for the season |
.Started | boolean | if the game was started or not |
.HasStats | boolean | if the game has game stats or not |