Skip to main content

NoneBot2 CS2 雷达插件,支持赛事/选手、5E、完美与官匹战绩查询及对局分析

Project description

nonebot-plugin-cs2radar

NoneBot2 的 CS2 插件,提供职业选手查询、近期赛事/赛果、5E 战绩、完美平台战绩、官匹战绩、账号绑定与单局详细复盘。

安装

使用 nb-cli

nb plugin install nonebot-plugin-cs2radar

使用 pip

pip install nonebot-plugin-cs2radar

安装 Playwright 浏览器

本插件依赖 playwright 渲染图片,请额外执行:

playwright install chromium

适配器

  • OneBot V11

命令

  • cs查询 <选手名>: 查询职业选手资料卡
  • cs赛事: 查询近期赛事与比赛
  • 赛果: 查询近几日赛果
  • 5e <ID/昵称>: 查询 5E 战绩
  • pwlogin <手机号> <验证码>: 登录完美平台并保存本地会话
  • pw <昵称/SteamID>: 查询完美平台战绩
  • bind <5e|pw> <玩家名>: 绑定常用查询对象
  • match [5e|pw|mm] [@群友] [局数]: 查询最近第 N 把详细对局并生成复盘

配置

环境变量统一使用 cs2radar_* 前缀;旧的 cs_pro_* 前缀当前仍兼容一版,但会打印弃用警告。

cs2radar_llm_enabled=true
cs2radar_llm_api_type=openai
cs2radar_llm_api_url=https://api.openai.com/v1
cs2radar_llm_api_key=
cs2radar_llm_model=gpt-4o-mini

说明:

  • LLM 配置为可选;未配置时仍可查询战绩,只是不生成 AI 复盘。
  • pw / match pw / match mm 依赖完美平台登录态,请先执行 pwlogin

数据存储与迁移

插件默认把数据存储到 nonebot-plugin-localstore 的插件数据目录下,并会尝试自动迁移旧版本的以下文件:

  • data/cs_pro/user_bindings.db
  • data/cs_pro/user_data.db
  • data/cs_pro/user_data.json
  • data/cs_pro/pw_session.json

常见问题

1. 提示找不到浏览器或渲染失败

请确认已经执行过:

playwright install chromium

2. pw 查询提示先登录

这是正常行为。完美平台接口需要有效登录态,请先执行:

pwlogin <手机号> <验证码>

3. AI 复盘没有返回

未配置 LLM Key、模型返回非 JSON、接口超时都会触发降级。此时插件仍会返回战绩图片,只是不附带 AI 结论。

License

MIT

发布

推送语义化标签后会自动触发 GitHub Actions 发布到 PyPI,例如:

git tag v0.1.0
git push origin v0.1.0

工作流优先使用仓库机密 PYPI_API_TOKEN;若未配置该机密,则回退为 PyPI Trusted Publishing。

Project details


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_cs2radar-0.1.0.tar.gz (41.2 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_cs2radar-0.1.0-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_cs2radar-0.1.0.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nonebot_plugin_cs2radar-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9609cea26a1067c4d14f32215ca17462640ad6e3205c7c807d12ffce24cd8bcf
MD5 2a047d500facc18b577d3115a6ed51ca
BLAKE2b-256 42010f5e53234a0e7e7d0229f1d8f1629e7eba32a083c7ce3a3a8e38239744cb

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on luojisama/nonebot-plugin-cs2radar

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_cs2radar-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_cs2radar-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8012a3fc3272c9542cdc9b4ca4d3ed42b172d637516138b34227e7a39ed56aff
MD5 3d67dd5d55d1ae6c8f92f2f0cdc8ab44
BLAKE2b-256 5eab7baa8a62d6640cd3024a8823f220691015f87dc79d1a4aa88ef16d00130f

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on luojisama/nonebot-plugin-cs2radar

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page