NoneBot 可自定义骰子的骰子插件
Project description
📖 介绍
可以自定义骰子的骰子插件
add_dice 攻击 未命中 命中 命中|命中
roll 攻击 2d6
骰子结果
攻击 ×1:命中|命中
d6 ×2:2,1
合计3,2命中
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-dice-helper
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-dice-helper
pdm
pdm add nonebot-plugin-dice-helper
poetry
poetry add nonebot-plugin-dice-helper
conda
conda install nonebot-plugin-dice-helper
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot-plugin-dice-helper"]
⚙️ 配置
可以在nonebot_plugin_localstore的plugin_config_dir里面建立一个default_data.json,配置全局的自定义骰子(不能被命令删除)。 格式如下
{
"custom_dice": {
"硬币": [
[
"正面"
],
[
"反面"
]
]
}
}
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
| roll | 群员 | 否 | 群聊/私聊 | 投指定骰子 参数为 数量骰子名1 数量骰子名2... 数量1可以省略 dn为数字骰,不需要定义 eg. roll 4d6 硬币 |
| dice_list | 群员 | 否 | 群聊/私聊 | 查看所有骰子 |
| add_dice | 群管理/超级用户 | 否 | 群聊/私聊 | 增加自定义骰子 参数为 骰子名 面1 面2... 一面可以有多个标记,用|隔开 eg. add_dice 攻击 未命中 命中 命中|命中 |
| del_dice | 群管理/超级用户 | 否 | 群聊/私聊 | 删除自定义骰子 |
效果图
有时间上传
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_dice_helper-0.1.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_dice_helper-0.1.0.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e564d8ea94f3a27192cbbe8e6d5478efd1e46a4c7f39ac9ba5c67aa80d4a0f41
|
|
| MD5 |
001feda79196d0602627650879847e5d
|
|
| BLAKE2b-256 |
20510441791d271e50503d3be62e9625603e80ea3696c8342138cd32d292e9e9
|
File details
Details for the file nonebot_plugin_dice_helper-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_dice_helper-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8552169279f25cecdd99c30c22bc82684a1275e1dbe82e0fdb82def7fd60a285
|
|
| MD5 |
0ae6aedbd0dcde650138bc4686c52229
|
|
| BLAKE2b-256 |
d9d37d2dceef0f8730aa0334f5c83747dc9650bf28e0f4ee871acb5e25e49ffb
|