Skip to main content

OSUbot in NoneBot2

Project description

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

💡 贡献

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

Project details


Release history Release notifications | RSS feed

This version

7.1.0

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.1.0.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.1.0-py3-none-any.whl (30.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_osubot-7.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 e2f2bf0e5e95ab7ebb7087a8af1929569477c3add5d95b2717ccb178c23747ff
MD5 9e2793d93c92faea36cc05fa30b0105b
BLAKE2b-256 1bc24cc66602dc2f5ad0733250ea6e467aed061819c48099d5bc5e32bfd8ac17

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_osubot-7.1.0.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.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_osubot-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 092760235b9fe1ac279a309395fea98d0705688c5c757ddaf8d8843de2d3dcb6
MD5 5db4ab935ae4d1299cac70b6020516d3
BLAKE2b-256 4dc3676ac3a664b14c99e27d6dd6c1fb4f403f224853abef00dd14170cd57ef7

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_osubot-7.1.0-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.

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