Skip to main content
NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-osubot

✨ NoneBot osubot ✨

license pypi codecov python

📖 介绍

本项目修改自osuv2,适配了nonebot2,并且在此之上修改了命令的响应逻辑并修改了一些bug使之更易于使用

变速功能依赖ffmpeg,需要自行安装ffmpeg才能正常使用

💿 安装

使用 nb-cli 安装(推荐) 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-osubot
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-osubot
pdm
pdm add nonebot-plugin-osubot
poetry
poetry add nonebot-plugin-osubot

打开 nonebot2 项目的 bot.py 文件, 在其中写入

nonebot.load_plugin('nonebot_plugin_osubot')

⚙️ 配置

你需要至OSU个人设置申请新的OAuth应用,然后将得到的客户端ID与客户端密钥填入nonebot2 项目的.env文件中

配置说明

配置项 必填 默认值 说明
OSU_CLIENT 客户端ID
OSU_KEY 客户端密钥
SQLALCHEMY_DATABASE_URL sqlite+aiosqlite:///db.sqlite3 数据库地址,详见 NoneBot 数据库配置
INFO_BG ['https://example.com'] 随机背景api地址,需要打开网页后随机获得一张图片

⚠️ 从 v6 升级到 v7

v7 将底层 ORM 从 tortoise-orm 迁移至 nonebot-plugin-orm,数据库表名和结构发生了变化,升级前需手动执行迁移脚本,否则数据将丢失。

升级步骤:

  1. 停止 bot
  2. 在 bot 根目录下运行迁移脚本:
# 默认 SQLite(自动从 .env 读取数据库地址)
python migrate.py

# 或手动指定数据库地址
python migrate.py sqlite:///db.sqlite3
python migrate.py postgresql://user:pass@localhost/dbname
python migrate.py mysql+pymysql://user:pass@localhost/dbname
  1. 标记迁移版本:
nb orm stamp 68a04ea31d05
  1. 升级插件后重启 bot

🎉 使用

指令

image

AI 自然语言调用(可选)

如果同一个 NoneBot 项目中安装并加载了 nonebot-plugin-ai-groupmate,本插件会自动向 ai-groupmate 注册 osu 查询工具。用户可以通过自然语言让 AI 调用 osubot 的查询能力,而不是直接输入固定命令。

没有安装或没有加载 nonebot-plugin-ai-groupmate 时,本功能会自动跳过,不影响 osubot 原有指令使用。

示例:

@bot 查我的 bp1
@bot 查我的 info
@bot 查 peppy 的 bp1
@bot 查 WhiteCat 的 bp 1-20
@bot 查 @群友 的 bp1
@bot 查我在 3783810 这张图上的成绩
@bot 查我的 pp 历史
@bot 分析我的 bp 构成
@bot 给我推荐谱面
@bot 发一下我的 osu 主页
@bot 查 match 123456789
@bot 查 match 123456789 的 rating
@bot 预览谱面 3783810
@bot 提取谱面 3783810 的背景
@bot 查成就 Non-stop Dancer

账号与模式规则:

  • 用户说“我/我的/自己”或未指定玩家时,使用当前发言用户通过 /bind 绑定的 osu 账号。
  • 消息里 @群友 时,优先使用被 @ 群友绑定的 osu 账号。
  • 查询绑定用户时会使用绑定记录中的默认模式与 lazer/stable 设置。
  • 明确指定 osu 用户名时会查询该 osu 用户名;如果需要非 std 模式,请在自然语言里说明 taikoctbmania

如果用户只是要求查询,AI 会调用工具发出图片后结束;如果用户同时要求评价,例如:

@bot 查我的 bp1,我打得怎么样
@bot 分析一下 @群友 的 bp1
@bot 看看我 recent 发挥如何

工具会把生成的图片回传给支持多模态的主模型,AI 可以基于图片内容给出简短评价。该分析能力依赖 ai-groupmate 当前配置的主聊天模型支持多模态输入。

💡 贡献

如果遇到任何问题,欢迎提各种issue来反馈bug 你也可以加群(228986744)来进行反馈! 1665504476458_temp_qrcode_share_9993

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_osubot-7.2.6.tar.gz (30.3 MB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_osubot-7.2.6-py3-none-any.whl (30.4 MB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_osubot-7.2.6.tar.gz.

File metadata

  • Download URL: nonebot_plugin_osubot-7.2.6.tar.gz
  • Upload date:
  • Size: 30.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nonebot_plugin_osubot-7.2.6.tar.gz
Algorithm Hash digest
SHA256 af38900f4e18cf6121dc297d9a966957cda114049f776d4ff1efff833fbf344f
MD5 583717acf058c1a0f6442ff3c17056f6
BLAKE2b-256 ebc55e1fe20e97b551a12f91d9208e35f863cfc6e9d9e6a6099fe28e1f48059c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_osubot-7.2.6.tar.gz:

Publisher: pypi-publish.yml on yaowan233/nonebot-plugin-osubot

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_osubot-7.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_osubot-7.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 691479f6ebdcc004e7a14ad97427f3c229971276fd458953aa9be6a367dd9919
MD5 7186800330975a2e62aecdb3eae984f4
BLAKE2b-256 2cc5db689e098f4cf39ef658c629af0dc7f086b1c1186b3658f82a7313b98c77

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_osubot-7.2.6-py3-none-any.whl:

Publisher: pypi-publish.yml on yaowan233/nonebot-plugin-osubot

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

Release history Release notifications | RSS feed

7.4.0

2 files

7.3.0

2 files

7.2.8

2 files

7.2.7.1

2 files

This release

7.2.6 This release

2 files

7.2.5

2 files

7.2.4

2 files

7.2.3

2 files

7.2.2

2 files

7.2.1

2 files

7.2.0

2 files

7.1.3

2 files

7.1.2

2 files

7.1.1

2 files

7.1.0

2 files

7.0.4

2 files

7.0.3

2 files

7.0.2

2 files

7.0.1

2 files

7.0.0

2 files

6.28.0

2 files

6.27.4

2 files

6.27.3

2 files

6.26.8

2 files

6.26.7

2 files

6.26.6

2 files

6.26.5

2 files

6.26.4

2 files

6.26.2

1 file

6.26.1

1 file

6.25.0

2 files

6.24.2

2 files

6.24.1

2 files

6.24.0

2 files

6.23.1

2 files

6.23.0

2 files

6.22.3

2 files

6.22.1

2 files

6.22.0

2 files

6.21.0

2 files

6.20.1

2 files

6.20.0

2 files

6.19.0

2 files

6.18.1

2 files

6.18.0

2 files

6.17.1

2 files

6.17.0

2 files

6.16.0

2 files

6.15.1

2 files

6.15.0

2 files

6.14.0

2 files

6.13.2

2 files

6.13.1

2 files

6.13.0

2 files

6.12.7

2 files

6.12.6

2 files

6.12.5

2 files

6.12.4

2 files

6.12.3

2 files

6.12.2

2 files

6.12.1

2 files

6.12.0

2 files

6.11.1

2 files

6.11.0

2 files

6.10.0

2 files

6.9.3

2 files

6.9.2

2 files

6.9.1

2 files

6.9.0

2 files

6.8.1

2 files

6.8.0

2 files

6.7.12

2 files

6.7.11

2 files

6.7.10

2 files

6.7.9

2 files

6.7.8

2 files

6.7.7

2 files

6.7.6

2 files

6.7.5

2 files

6.7.4

2 files

6.7.3

2 files

6.7.2

2 files

6.7.1

2 files

6.7.0

2 files

6.6.1

2 files

6.5.6

2 files

6.5.5

2 files

6.5.4

2 files

6.5.3

2 files

6.5.2

2 files

6.5.1

2 files

6.5.0

2 files

6.4.7

2 files

6.4.6

2 files

6.4.5

2 files

6.4.4

2 files

6.4.3

2 files

6.4.2

2 files

6.4.1

2 files

6.4.0

2 files

6.3.2

2 files

6.3.1

2 files

6.3.0

2 files

6.2.3

2 files

6.2.2

2 files

6.2.1

2 files

6.1.2

2 files

6.1.1

2 files

6.1.0

2 files

6.0.7

2 files

6.0.6

2 files

6.0.5

2 files

6.0.4

2 files

6.0.3

2 files

6.0.2

2 files

6.0.1

2 files

6.0.0

2 files

5.8.5

2 files

5.8.4

2 files

5.8.3

2 files

5.8.2

2 files

5.8.1

2 files

5.8.0

2 files

5.7.3

2 files

5.7.2

2 files

5.7.1

2 files

5.7.0

2 files

5.6.0

2 files

5.5.3

2 files

5.5.2

2 files

5.5.1

2 files

5.5.0

2 files

5.4.1

2 files

5.4.0

2 files

5.3.0

2 files

5.2.4

2 files

5.2.3

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.1

2 files

5.0.0

2 files

4.2.4

2 files

4.2.3

2 files

4.2.2

2 files

4.2.1

2 files

4.2.0

2 files

4.1.0

2 files

4.0.19

2 files

4.0.18

2 files

4.0.17

2 files

4.0.16

2 files

4.0.15

2 files

4.0.14

2 files

4.0.13

2 files

4.0.12

2 files

4.0.11

2 files

4.0.9

2 files

4.0.8

2 files

4.0.7

2 files

4.0.6

2 files

4.0.5

2 files

4.0.4

2 files

4.0.3

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.5.2

2 files

3.5.1

2 files

3.0.0

2 files

2.0.0.post2

2 files

2.0.0.post1

2 files

2.0.0

2 files

1.8.0

2 files

1.0.0

2 files

0.13.2

2 files

0.1.5

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