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.1.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.1-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_cs2radar-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d80d345ed2e05dc406e1676fa973c827294bceb9fa8293eb0376226050b3ba13
MD5 664c0c1c16c6d26029104a313c1187e1
BLAKE2b-256 ae4ba48c361befde27dcad1d36e517dbaf46dd86fed53e7a5531a7daa2cec223

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_cs2radar-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_cs2radar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7138e0736448bf44c44993b6897b1f4079f69a13cd5f1f0cb32cd5f7dc6fc929
MD5 86fcfb26cf66916f2b38fd89b151d00d
BLAKE2b-256 d58735c1ca9e9f441288ac96892f108c40defe7bc2b19805a45fbd1eea0b3ae9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_cs2radar-0.1.1-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