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.2.tar.gz (7.0 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.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_dice_helper-0.1.2.tar.gz
Algorithm Hash digest
SHA256 29aeb1ee447d46a8e729beb2d1886361f1606b8c1ce7f32247628a7fba0d61a2
MD5 3045a64652e32fc705b0f148b18357b3
BLAKE2b-256 c7156e8e07af6018bbfa79c6cb5df0a6b0cc5c59872cac88ced37c5e8d0fa2dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_dice_helper-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eeafcde2f88a61853f3fa9c09483b6f4040f758e7cf404aa03c11d9c1e40841f
MD5 528d8065729ae6f60ee56df062d7b50a
BLAKE2b-256 086581aa9314bcbea9dcc93d2bc73291ce2b574bdaa6b6cabf70665c8c026103

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