Skip to main content

nonebot-plugin-game-uid

一个用于记录和查询群友游戏 UID 的 NoneBot2 插件,支持星布谷地、原神、崩坏:星穹铁道和绝区零。

功能

  • 每位 QQ 用户可分别绑定四款游戏的 UID
  • 重复绑定同一游戏时自动更新 UID
  • 查询自己的全部 UID 或指定游戏 UID
  • 在群聊中通过 @群友 查询对方主动绑定的 UID
  • 按“群名片:UID”列出本群已经绑定指定游戏的群友
  • SUPERUSER 可设置定时播报,周期性提示群友使用 UID 列表命令
  • 删除自己的指定游戏 UID
  • 一键清空自己的全部 UID,或只清空指定游戏 UID
  • 使用 SQLite 异步持久化,无需外部数据库或游戏 API
  • 兼容“星布谷底”“星铁”“铁道”“崩铁”等常用别名

安装

使用 nb-cli 安装

nb plugin install nonebot-plugin-game-uid

使用 pip 安装

pip install nonebot-plugin-game-uid

使用 Poetry 安装

poetry add nonebot-plugin-game-uid

插件仅支持 OneBot V11 适配器。安装后请在 NoneBot 配置中加载 nonebot_plugin_game_uid。

配置

所有配置项都有默认值,插件可以零配置加载。数据库默认由 nonebot-plugin-localstore 保存到插件数据目录。如需自定义数据库位置,在 .env 中添加:

GAME_UID_DB_PATH=data/game_uid/uid.db
GAME_UID_LIST_LIMIT=100
配置项 默认值 说明
game_uid_db_path 空(localstore 插件数据目录下的 uid.db) 可选的自定义 SQLite 数据库文件路径
game_uid_list_limit 100 群 UID 列表单次最多显示人数

UID 按 QQ 用户全局保存,不按群分别存储。群友只能查询用户主动绑定的 UID。

使用方法

指令 权限 范围 说明
/绑定UID <游戏> <UID> 所有人 群聊/私聊 绑定或更新自己的 UID
/游戏UID 所有人 群聊/私聊 查看自己的全部 UID
/游戏UID [游戏] 所有人 群聊/私聊 查看自己的指定 UID
/游戏UID [游戏] @群友 所有人 群聊 查看群友的指定 UID
/游戏UID @群友 所有人 群聊 查看群友的全部 UID
/删除UID <游戏> 所有人 群聊/私聊 删除自己的指定 UID
/清空UID [游戏] 所有人 群聊/私聊 有参数时清空指定游戏;无参数时一键清空自己的全部 UID
/绑定帮助 所有人 群聊/私聊 查看支持的游戏、绑定格式和常用操作示例
/群UID <游戏> 所有人 群聊 按“群名片:UID”查看本群列表
/设置UID提醒 <间隔> <游戏> SUPERUSER 群聊 开启或更新定时播报
/关闭UID提醒 SUPERUSER 群聊 关闭定时播报
/UID提醒状态 所有人 群聊 查看本群提醒状态
/UID帮助 所有人 群聊/私聊 查看命令帮助

支持的游戏名及常用别名:

  • 星布谷地:星布谷地、星布谷底、星布、谷地、谷底
  • 原神:原神、ys
  • 崩坏:星穹铁道:星铁、铁道、崩铁、星穹铁道、hsr
  • 绝区零:绝区零、绝区、zzz

UID 必须为 5~20 位半角数字。

提醒间隔支持 分钟、小时、天,范围为 10 分钟到 30 天。每个群保存一条提醒设置,再次设置会覆盖旧设置。机器人重启后设置仍然有效。

示例

用户:/绑定UID 原神 100123456
机器人:已绑定原神 UID:100123456

用户:/游戏UID 原神
机器人:你的 UID:
       原神:100123456

用户:/删除UID 原神
机器人:已删除原神 UID。

用户:/清空UID
机器人:已一键清空你的全部游戏 UID(共 2 项)。

用户:/绑定帮助
机器人:UID 绑定帮助
       绑定:/绑定UID <游戏> <UID>
       示例:/绑定UID 原神 100123456
       查询:/游戏UID [游戏] [@群友]
       删除指定游戏:/删除UID <游戏>
       清空指定游戏:/清空UID <游戏>
       清空全部:/清空UID
       支持游戏:星布谷地、原神、星铁、绝区零
       UID 必须是 5~20 位半角数字。

用户:/群UID 原神
机器人:本群原神 UID 列表(2人):
       提瓦特旅行者:100123456
       应急食品:100654321

SUPERUSER:/设置UID提醒 6小时 原神
机器人:已设置原神 UID 定时提醒,每 6小时发送一次。
       提醒内容:
       想查看本群群友的原神 UID 并添加游戏好友?
       发送 /群UID 原神,即可查看群友主动绑定的 UID(群名片:UID)。

       全部命令:
       /绑定UID <游戏> <UID> — 绑定或更新自己的 UID
       /游戏UID [游戏] [@群友] — 查询自己或群友的 UID
       /删除UID <游戏> — 删除自己的指定游戏 UID
       /清空UID [游戏] — 清空自己的指定游戏或全部 UID
       /绑定帮助 — 查看 UID 绑定说明和示例
       /群UID <游戏> — 查看本群“群名片:UID”列表
       /设置UID提醒 <间隔> <游戏> — SUPERUSER 开启或更新定时提醒
       /关闭UID提醒 — SUPERUSER 关闭定时提醒
       /UID提醒状态 — 查看本群提醒设置
       /UID帮助 — 查看完整帮助

开发

poetry install
poetry run pytest
poetry run ruff check .
poetry run python -m compileall nonebot_plugin_game_uid

许可证

MIT

Metadata

Release files for nonebot-plugin-game-uid 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-game-uid 0.3.0
File Size Uploaded Provenance Actions
nonebot_plugin_game_uid-0.3.0.tar.gz 11.8 kB Without provenance Details for nonebot_plugin_game_uid-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-game-uid 0.3.0
File Interpreter ABI Platform Actions
nonebot_plugin_game_uid-0.3.0-py3-none-any.whl Python 3 none any Details for nonebot_plugin_game_uid-0.3.0-py3-none-any.whl

Total release size: 25.4 kB

Release files / nonebot_plugin_game_uid-0.3.0.tar.gz

Download URL nonebot_plugin_game_uid-0.3.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a6cce11a8dec3246f0fc4ac90f97200729ef9a8db642cffd522608aa8adeb144
BLAKE2b-256 checksum
How to use checksums
250bddfab8ff371a2623d33724fca5221773b3dde9deafd4699cf1e9e123be6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Darwin/27.0.0

Release files / nonebot_plugin_game_uid-0.3.0-py3-none-any.whl

Download URL nonebot_plugin_game_uid-0.3.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ea1a5546561c7277158f24886e447510d3f9df5144e34bf5eaaf80728121f26
BLAKE2b-256 checksum
How to use checksums
101df8e8d5352500803a2c05f03f633e59c3840d84799ba9b871cdadde90a4eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.4.1 CPython/3.11.15 Darwin/27.0.0

Security for nonebot-plugin-game-uid 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

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