Skip to main content
NoneBotPluginLogo

NoneBotPluginText

NoneBot-Plugin-Tsugu-BanGDream-Bot

✨ Koishi-Plugin-Tsugu-BanGDream-Bot 的 NoneBot2 实现 ✨

license license pypi python

koishi-plugin-tsugu-bangdream-bot 的 NoneBot2 实现,旨在于 NoneBot 上还原 Tsugu Bot 的使用。

📖 介绍

在 NoneBot2 上进行的对于 koishi-plugin-tsugu-bangdream-bot 的复刻,支持跨平台,支持自定义。

基于 NoneBot-Plugin-Alconna 和 nonebot-plugin-userinfo 实现跨平台支持。

基于 tsugu-api-python 实现与 Tsugu 后端的连接。

💿 安装

⚠ 使用警告 ⚠

若运行本插件时出现了如下异常信息:

ImportError: Failed to import httpx and aiohttp, please install one of them to use this plugin.

表示你的 Nonebot 项目没有使用 HTTP 客户端驱动,也没有运行在安装了 httpx 库或 aiohttp 库的环境。

请确保使用了 HTTP 客户端驱动或安装了这两个库的其中一个。

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

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

plugins = ["nonebot-plugin-tsugu-bangdream-bot"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

nonebot-plugin-tsugu-bangdream-bot 并无必填配置,但仍然建议对部分配置进行添加。

配置项 必填 默认值 说明
TSUGU_USE_EASY_BG 否 False 是否使用简易背景,启用这将大幅提高速度,关闭将使部分界面效果更美观
TSUGU_COMPRESS 否 False 是否压缩图片,启用会使图片质量下降,但是体积会减小,从而减少图片传输时所需的时间
TSUGU_BANDORI_STATION_TOKEN 否 None BandoriStationToken, 用于发送车牌,可以去 BandoriStation 申请。缺失情况下,视为Tsugu车牌
TSUGU_REPLY 否 False 消息是否回复用户
TSUGU_AT 否 False 消息是否@用户
TSUGU_NO_SPACE 否 False 是否启用无需空格触发大部分指令,启用这将方便一些用户使用习惯,但会增加bot误判概率,仍然建议使用空格
TSUGU_RETRIES 否 3 重试次数配置,配置 <= 0 时代表关闭重试机制
TSUGU_BACKEND_URL 否 "http://tsugubot.com:8080" 后端服务器地址,用于处理指令。如果有自建服务器,可以改成自建服务器地址。默认为Tsugu公共后端服务器。
TSUGU_DATA_BACKEND_URL 否 "http://tsugubot.com:8080" 用户数据后端服务器地址,用于处理用户与车牌指令。如果有自建服务器,可以改成自建服务器地址。默认为Tsugu公共后端服务器。
TSUGU_PROXY 否 "" 使用的代理服务器。在部分地区,网络环境可能无法连接后端服务器。通过此配置项配置代理服务器。
TSUGU_TIMEOUT 否 10 后端服务器的响应超时时间(秒)
TSUGU_BACKEND_PROXY 否 False 是否通过代理服务器访问后端服务器
TSUGU_DATA_BACKEND_PROXY 否 False 是否通过代理服务器访问用户数据后端服务器
TSUGU_OPEN_FORWARD_ALIASES 否 () 开启车牌转发指令别名
TSUGU_CLOSE_FORWARD_ALIASES 否 () 关闭车牌转发指令别名
TSUGU_BIND_PLAYER_ALIASES 否 () 绑定玩家指令别名
TSUGU_UNBIND_PLAYER_ALIASES 否 () 解除绑定指令别名
TSUGU_MAIN_SERVER_ALIASES 否 () 切换服务器模式指令别名
TSUGU_DEFAULT_SERVERS_ALIASES 否 () 切换显示服务器列表指令别名
TSUGU_PLAYER_STATUS_ALIASES 否 () 用户玩家状态指令别名
TSUGU_PLAYER_LIST_ALIASES 否 () 用户玩家状态列表指令别名
TSUGU_SWITCH_INDEX_ALIASES 否 () 切换默认玩家 ID 指令别名
TSUGU_YCM_ALIASES 否 () 查询车牌指令别名
TSUGU_SEARCH_PLAYER_ALIASES 否 () 查询玩家指令别名
TSUGU_SEARCH_CARD_ALIASES 否 () 查卡指令别名
TSUGU_CARD_ILLUSTRATION_ALIASES 否 () 查卡面指令别名
TSUGU_SEARCH_CHARACTER_ALIASES 否 () 查角色指令别名
TSUGU_SEARCH_EVENT_ALIASES 否 () 查活动指令别名
TSUGU_SEARCH_SONG_ALIASES 否 () 查曲指令别名
TSUGU_SONG_CHART_ALIASES 否 () 查谱面指令别名
TSUGU_SONG_RANDOM_ALIASES 否 () 随机曲目指令别名
TSUGU_SONG_META_ALIASES 否 () 查歌曲分数表指令别名
TSUGU_EVENT_STAGE_ALIASES 否 () 查试炼舞台指令别名
TSUGU_SEARCH_GACHA_ALIASES 否 () 查卡池指令别名
TSUGU_YCX_ALIASES 否 () 查询预测线指令别名
TSUGU_YCX_ALL_FORWARD_ALIASES 否 () 查询全榜预测线指令别名
TSUGU_LSYCX_ALIASES 否 () 查询历史预测线指令别名
TSUGU_GACHA_SIMULATE_ALIASES 否 () 抽卡模拟指令别名

🎉 使用

参考 关于 Tsugu V3.0

引用

本插件使用或参考了以下插件/项目

Metadata

Release files for nonebot-plugin-tsugu-bangdream-bot 0.4.6

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-tsugu-bangdream-bot 0.4.6
File Size Uploaded Provenance
nonebot_plugin_tsugu_bangdream_bot-0.4.6.tar.gz 20.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-tsugu-bangdream-bot 0.4.6
File Interpreter ABI Platform
nonebot_plugin_tsugu_bangdream_bot-0.4.6-py3-none-any.whl Python 3 none any Details

Total release size: 40.4 kB

Release files / nonebot_plugin_tsugu_bangdream_bot-0.4.6.tar.gz

Download URL nonebot_plugin_tsugu_bangdream_bot-0.4.6.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
493a86bf7245e49e423d0a5f99577107e81b7844ff634255a63e62aa542131b7
BLAKE2b-256 checksum
How to use checksums
8f3bc4b7ef7f1f3e8c4d68730323ab13a2237e1e9f657481b2d531f8327d810d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.23.0 CPython/3.12.3 Linux/6.8.0-1021-azure

Release files / nonebot_plugin_tsugu_bangdream_bot-0.4.6-py3-none-any.whl

Download URL nonebot_plugin_tsugu_bangdream_bot-0.4.6-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45cf07481e12d443cfe2674a621420586c8e8463585670476efb3c624ebbf7bb
BLAKE2b-256 checksum
How to use checksums
8c4302d2ed4da8e364b7f2281f4a29a3cbf5d9d205cafb57d6adc9056d9bdd88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.23.0 CPython/3.12.3 Linux/6.8.0-1021-azure

Security for nonebot-plugin-tsugu-bangdream-bot 0.4.6

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.

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