Skip to main content

NoneBot 可自定义骰子的骰子插件

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-dice-helper

✨ NoneBot 可自定义骰子的骰子插件 ✨

license pypi python

📖 介绍

可以自定义骰子的骰子插件

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

nonebot_plugin_dice_helper-0.1.0.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

nonebot_plugin_dice_helper-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_dice_helper-0.1.0.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_dice_helper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e564d8ea94f3a27192cbbe8e6d5478efd1e46a4c7f39ac9ba5c67aa80d4a0f41
MD5 001feda79196d0602627650879847e5d
BLAKE2b-256 20510441791d271e50503d3be62e9625603e80ea3696c8342138cd32d292e9e9

See more details on using hashes here.

File details

Details for the file nonebot_plugin_dice_helper-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_dice_helper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8552169279f25cecdd99c30c22bc82684a1275e1dbe82e0fdb82def7fd60a285
MD5 0ae6aedbd0dcde650138bc4686c52229
BLAKE2b-256 d9d37d2dceef0f8730aa0334f5c83747dc9650bf28e0f4ee871acb5e25e49ffb

See more details on using hashes here.

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