Skip to main content

nonebot-plugin-ba-tools

NoneBotPluginBaToolsLogo

license PyPI NoneBot Python

📖 介绍

[!IMPORTANT] 由于学业繁忙(2025),本项目暂时停止维护,如您有兴趣继续维护本项目,请联系我

QQ: 2969709268

email: hanasakayui2022@gmail.com

目标是做 BlueArchive 最好用的工具箱

💿 安装

使用 nb-cli 安装

在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装

    nb plugin install nonebot-plugin-ba-tools
使用包管理器安装

在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令

pip
  pip install nonebot-plugin-ba-tools

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

    plugins = ["nonebot_plugin_ba_tools"]

🎉 使用

💡 数据来源

本项目在 Schale DB 的基础上新增了 l2d 文件夹,请在 release 中下载相应文件并解压至相应目录下 v0.1.6 已实现网络请求资源文件,无需再自行配置资源文件

🔧 插件配置

[!Caution] 在v0.5.0-beta及以上版本中,插件配置方式发生了变动,如配置了旧版本的配置文件,需要手动迁移配置

配置默认路径为:

  • macOS: same as user_data_dir
  • Unix: ~/.config/nonebot2/nonebot_plugin_ba_tools/
  • WinXP (roaming): C:\Documents and Settings\<username>\Local Settings\Application Data\nonebot2\nonebot_plugin_ba_tools\
  • Win 7 (roaming): C:\Users\<username>\AppData\Roaming\nonebot2\nonebot_plugin_ba_tools\

[!TIP] 如果你想自定义配置文件路径,可以向nonebot配置文件中添加BA_TOOLS_CONFIG_PATH项,值为你想要的路径

默认插件配置项如下:

pic:
  loading_switch: true
  max_pic_num: 5
  pixiv_nginx: "https://i.pixiv.re"
  send_pic_info: true
  r18_switch: false

chat:
  enable: false
  current_model: "<model_name>"
  models:
    - name: "<model_name>"
      base_url: "<model_endpoint>"
      api_key: "<your_api_key>"
  reply_mode: text

webui:
  enable: true
  path: "/batools"
  api_access_token: ""
  username: "admin"
  password: "admin"

图片配置 (PicConfig)

配置项 默认值 描述
loading_switch true 是否开启图片加载通知
max_pic_num 5 单次最大获取的图片数量
pixiv_nginx "https://i.pixiv.re" pixiv图床反代
send_pic_info true 发送涩图时是否发送图片信息
r18_switch false 是否开启R18

聊天配置 (ChatConfig)

配置项 默认值 描述
enable false 是否开启LLM Chat
current_model "" 当前模型
models [] Chat Model列表
reply_mode "text" 回复模式(text/image)

WebUI配置 (WebUIConfig)

配置项 默认值 描述
enable true 是否启用 BA Tools WebUI
path "batools" WebUI 路径
api_access_token "" WebUI 访问令牌
username "admin" WebUI 用户名
password "admin" WebUI 密码

聊天模型配置 (ChatModel)

配置项 类型 描述
name string 模型名称
base_url string 模型接口地址
api_key string API密钥

✨ 功能介绍

  • 每日 00:00 在以订阅的群聊中自动推送学生生日信息
  • 获取当月过生日的学生列表
  • 获取学生详细信息
  • 获取活动列表
  • 获取 ba 千里眼
  • 获取攻略(关卡攻略/总力战攻略/大决战攻略/竞技场攻略/火力演习攻略)
  • 好感度计算
  • 获取/抽取 ba 漫画(目前只能获取到(二创?)漫画,将来可能会支持更多的漫画)
  • 获取 ba 表情包
  • 自动推送总力战/大决战信息 基于 bilibili 动态(目前只做了日服)
  • 获取 ba 涩图(基于自建的数据库)
  • 获取 ba meme(基于自建的图库,质量尽可能高了)
  • 获取 ba 人权
  • 获取 ba 总力战信息
  • 使用llm进行角色扮演对话
  • WebUI 管理界面

🤖 指令表

[!WARNING] 此处示例中的"/"为 nb 默认的命令开始标志,若您设置了另外的标志,则请使用您设置的标志作为开头

指令 权限 需要@ 说明 示例
ba学生生日订阅 <操作名> 管理员/群主以及 SUPERUSER 无 在此群订阅/取消订阅学生生日推送 /ba学生生日订阅 开启/关闭
ba总力战订阅 <操作名> 管理员/群主以及 SUPERUSER 无 在此群订阅/取消订阅总力战/大决战推送 /ba总力战订阅 开启/关闭
ba千里眼 <服务器名> 无 无 获取 ba 千里眼信息 /ba千里眼 国服/国际服
ba活动一览 无 无 获取 ba 活动信息 /ba活动一览
ba攻略 <攻略名称> 无 无 获取 ba 攻略 /ba攻略 关卡2-1/国服大决战
ba可用攻略 无 无 查询可用的攻略 /ba可用攻略
ba漫画 <参数(见示例)> 无 无 获取 ba(二创?)漫画 /ba漫画 抽取/第104话
ba学生生日表 <参数(见示例)> 无 无 获取某月的学生生日表 /ba学生生日表 当月/9月
ba涩图 [num] [tags] [isAI] [restrict] 无 无 获取 ba 涩图,使用方法详见下方 /ba涩图 num 2或者/ba涩图
ba涩图上传 <pid> 无 无 上传涩图至数据库,参数为图片的 pid /ba涩图上传 124081225
bameme [num] 无 无 获取 ba meme,参数为要获取的数目,不填默认 1 张 /bameme 2或者/bameme
ba角色简评 无 无 获取角色简评 /ba角色简评
ba人权 无 无 获取 ba 人权 /ba人权
ba学生信息 <学生姓名> [level] 无 无 获取学生信息 /ba学生信息 晴奈
ba学生技能 <学生姓名> 无 无 获取学生技能信息 /ba学生技能 晴奈
/ba学生列表 无 无 获取可用学生列表 /ba学生列表
ba总力战档线 <服务器名> 无 无 获取总力战档线信息 /ba总力战档线 B服
ba总力战档线变化 <服务器名> 无 无 获取总力战档线变化的图表 /ba总力战档线变化 B服
ba总力战人数变化 <服务器名> 无 无 获取总力战参与人数变化的图表 /ba总力战人数变化 B服
ba总力战分数计算 <服务器名> 无 无 计算相应的分数 /ba总力战分数计算
ba可用boss 无 无 获取可用的 boss 名 /ba可用boss
ba学生生日分布 无 无 获取学生生日分布图 /ba学生生日分布
bachat <subcommand> [args] 无 无 调整llm设置 /bachat -h
  • 各指令(不支持所有服的指令)参数可用列表如下

ba攻略:关卡<关卡号>/国际服总力战/日服总力战/国际服大决战/日服大决战/国际服火力演习/日服火力演习/竞技场/三一礼物/互动家具/升星一图流/...
ba总力档线:日服/官服/b服/B服

  • ba 涩图的具体使用方法
参数名 参数值类型 是否必须 默认值
num int 否 1
tags list[str] 否 -
isAI bool 否 false
restrict Literal["safe", "r18"] 否 "safe"

例:


/ba涩图
/ba涩图 num 2 tags [BlueArchive] isAI true restrict safe
/ba涩图 num 2
/ba涩图 tags [小鸟游星野, BlueArchive]
/ba涩图 isAI true restrict r18

👥 参与共建

请加入 QQ 群991680169进行交流

🚩 TODO

  • 使用 nonebot-plugin-orm 重构插件数据

Metadata

Release files for nonebot-plugin-ba-tools 0.5.9.post3

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-ba-tools 0.5.9.post3
File Size Uploaded
nonebot_plugin_ba_tools-0.5.9.post3.tar.gz 6.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-ba-tools 0.5.9.post3
File Interpreter ABI Platform
nonebot_plugin_ba_tools-0.5.9.post3-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 MB

Release files / nonebot_plugin_ba_tools-0.5.9.post3.tar.gz

Download URL nonebot_plugin_ba_tools-0.5.9.post3.tar.gz
Size 6.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d44cd8694b4b8dfad5071b0a87acc3a3f36de19935c54c27e01c8f20fd7f1e3f
BLAKE2b-256 checksum
How to use checksums
dcdef2f63ab8f6c7a5fe62dc7164a60b243399034a5f6b48509bb7d7cbedda82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 16, 2025.

Transparency log

Release files / nonebot_plugin_ba_tools-0.5.9.post3-py3-none-any.whl

Download URL nonebot_plugin_ba_tools-0.5.9.post3-py3-none-any.whl
Size 6.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5f2181d6ca62d479e40f223fa3b26e5d52ff9b5c0ac0c088a85c83723191b36f
BLAKE2b-256 checksum
How to use checksums
fc9512b87ae6409ab2744e44a13f521984e144932cccfde2d1ab857ece0ae892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 16, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.9.post3 This release

2 release files

0.5.8

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release 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