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命中

代码我让AI写的,检查了下大致没问题

以后再添加抽卡,抽盲袋等方法

💿 安装

使用 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.1.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.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_dice_helper-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3cf8e28cb4ed8734f87680465b364491a63a4468b186bc8fb3c1f1578fe6f00c
MD5 42591c2ed92955187cf32f2380eb687f
BLAKE2b-256 8dafcf2b4f103ba07d344bbae1ed4957de458db5af5cd8dcbefb6944a87815fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_dice_helper-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e142a48f3f685196c35028ddbf33a1812305a1ffc3f2414011cb5d2e773e1a3
MD5 47d7972eefda306a7e764b5d4be1527b
BLAKE2b-256 88c0dfe10d903ec75c85ef708aa515d6a31fbe441a779760c145cd9c70794d9f

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