Skip to main content

nonebot-plugin-livetennis

Live tennis scores, today's fixtures and player rankings in your NoneBot2 bot — ATP, WTA, Challenger, ITF and juniors, powered by the Live Tennis API.

Disclosure / 声明: This plugin is written and maintained by the Live Tennis API team — it is vendor-authored. / 本插件由 Live Tennis API 官方团队编写和维护。

English | 简体中文


English

What it does

On-demand chat commands (no background polling, no schedulers):

Command Alias What you get
/tennis live /网球 实时 Matches in play right now, with set/game/point score, who is serving (*) and a break-point marker
/tennis today /网球 今日 Today's scheduled fixtures (UTC), earliest first
/tennis player <name> /网球 球员 <姓名> Player search: country, tour, current world ranking, plays/backhand, birth date
/tennis /网球 Bilingual help

Works on any adapter that can send plain text (supported_adapters=None).

Tier truth

Everything this plugin calls is on the free tier of the Live Tennis API: live scores (score/server/break-point state), players (including a player's own current ranking), fixtures and usage. The free tier allows 30 requests/minute and 100 requests/day — plenty for on-demand chat commands, but honestly not enough for continuous fast polling, which is why this plugin only calls the API when someone asks. (The rank-ordered rankings listing is a Pro endpoint; this plugin does not use it — it shows the ranking carried on the free player object.)

Install

Once the package is published on PyPI (pending):

pip install nonebot-plugin-livetennis
# or
nb plugin install nonebot-plugin-livetennis

Working today, straight from git:

pip install git+https://github.com/livetennisapi/nonebot-plugin-livetennis.git

Then enable it in your bot's pyproject.toml:

[tool.nonebot]
plugins = ["nonebot_plugin_livetennis"]

Configure

Get a free API key at https://livetennisapi.com/subscribe/free and add it to your bot's .env:

LIVETENNIS_API_KEY=your-key-here

Optional settings (defaults shown):

LIVETENNIS_API_BASE=https://api.livetennisapi.com/api/public/v1
LIVETENNIS_TIMEOUT=10.0
LIVETENNIS_MAX_LINES=12

Example output

Live now / 实时比分 (1):
[ATP] Cincinnati Masters QF
  Carlos Alcaraz* vs Jannik Sinner — 6-4 3-3 (30-40) [BP 破发点]

* marks the server; [BP] appears when the receiver holds a break point (receiver at AD, or at 40 with the server on 0/15/30 — never shown in tiebreaks or when the state is unknown).

Development

pip install -e . --group dev
ruff check . && ruff format --check .
pytest

Docs: https://docs.livetennisapi.com · Spec: livetennisapi/openapi


简体中文

功能

按需触发的聊天指令(无后台轮询、无定时任务):

指令 别名 内容
/tennis live /网球 实时 当前进行中的比赛:盘/局/分比分、发球方(*)与破发点标记
/tennis today /网球 今日 今日赛程(UTC),按时间先后排列
/tennis player <name> /网球 球员 <姓名> 球员搜索:国籍、巡回赛、当前世界排名、持拍手/反手、出生日期
/tennis /网球 双语帮助

支持所有能发送纯文本的适配器(supported_adapters=None)。

套餐说明(如实)

本插件调用的全部接口均属于 Live Tennis API 的免费套餐:实时比分(比分/发球方/破发点状态)、球员(含球员自身的当前排名)、赛程与用量查询。免费套餐限额为每分钟 30 次、每天 100 次——足够按需查询使用,但适合持续高频轮询,因此本插件只在用户发出指令时才调用接口。(按名次排序的排名列表属于 Pro 接口,本插件不使用它,而是展示免费球员对象上自带的排名。)

安装

PyPI 发布后(待发布):

pip install nonebot-plugin-livetennis
# 或
nb plugin install nonebot-plugin-livetennis

当前可直接从 git 安装:

pip install git+https://github.com/livetennisapi/nonebot-plugin-livetennis.git

然后在机器人的 pyproject.toml 中启用:

[tool.nonebot]
plugins = ["nonebot_plugin_livetennis"]

配置

https://livetennisapi.com/subscribe/free 免费申请 API 密钥,写入机器人的 .env

LIVETENNIS_API_KEY=你的密钥

可选配置(默认值如下):

LIVETENNIS_API_BASE=https://api.livetennisapi.com/api/public/v1
LIVETENNIS_TIMEOUT=10.0
LIVETENNIS_MAX_LINES=12

输出示例

Live now / 实时比分 (1):
[ATP] Cincinnati Masters QF
  Carlos Alcaraz* vs Jannik Sinner — 6-4 3-3 (30-40) [BP 破发点]

* 表示发球方;当接发球方握有破发点时显示 [BP 破发点](接发球方 AD,或接发球方 40 而发球方为 0/15/30;抢七局不显示,状态未知时不显示)。

文档:https://docs.livetennisapi.com · 接口规范:livetennisapi/openapi

License

MIT © Live Tennis API

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_livetennis-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_livetennis-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_livetennis-0.1.0.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_livetennis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21f1f858486e46c8ab0e2a14949aed76d6811b4c689632cc194e120d32554b0a
MD5 20c5e8cb8dc6a18aa8b65dfe9cc931b0
BLAKE2b-256 fcc2db4dd9cf9032db39fdba2abf107736c11ed10b6fc99d752114994cbbd040

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_livetennis-0.1.0.tar.gz:

Publisher: publish.yml on livetennisapi/nonebot-plugin-livetennis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_livetennis-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_livetennis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 463715a9850241462bf66397054a368d84d9e9beb6439f95b2f0b49264cc1aa7
MD5 582675117fb83271b88aa619fadd4383
BLAKE2b-256 2831aad5f22c154213a59a8b44c2f363518bd61ca3ec82def322e6f77000b491

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_livetennis-0.1.0-py3-none-any.whl:

Publisher: publish.yml on livetennisapi/nonebot-plugin-livetennis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page