随机禁言一名群员或自己n分钟(n通过参入数字然后随机实现),简单粗暴。
Project description
适用于nonebot2 v11的随机禁言一名群员或自己n分钟 插件
注意:需要给bot管理员才能使用。
🔧 开发环境
Nonebot2:2.0.0b5
python:3.8.13
操作系统:Windows10(Linux兼容性问题不大)
编辑器:pycharm
💿 安装
1. nb-cli安装(推荐)
在你bot工程的文件夹下,运行cmd(运行路径要对啊),执行nb命令安装插件,插件配置会自动添加至配置文件
nb plugin install nonebot_plugin_random_ban
2. 本地安装
将项目clone到你的机器人插件下的对应插件目录内(一般为机器人文件夹下的src/plugins
),然后把nonebot_plugin_random_ban
文件夹里的内容拷贝至上一级目录即可。
clone命令参考(得先装git
,懂的都懂):
git clone https://github.com/Ikaros-521/nonebot_plugin_random_ban.git
也可以直接下载压缩包到插件目录解压,然后同样提取nonebot_plugin_random_ban
至上一级目录。
目录结构: 你的bot/src/plugins/nonebot_plugin_random_ban/__init__.py
3. pip安装
pip install nonebot_plugin_random_ban
打开 nonebot2 项目的 bot.py
文件, 在其中写入
nonebot.load_plugin('nonebot_plugin_random_ban')
当然,如果是默认nb-cli创建的nonebot2的话,在bot路径pyproject.toml
的[tool.nonebot]
的plugins
中添加nonebot_plugin_random_ban
即可
pyproject.toml配置例如:
[tool.nonebot]
plugin_dirs = ["src/plugins"]
plugins = ["nonebot_plugin_random_ban"]
更新版本
nb plugin update nonebot_plugin_random_ban
🔧 配置
env配置
# nonebot_plugin_random_ban
# 任何人都可以使用 随机禁言,开启后将会迎来至暗时刻
anyone_can_random_ban = False
配置项 | 必填 | 默认值 | 说明 |
---|---|---|---|
nonebot_plugin_random_ban |
否 | False |
任何人都可以使用 随机禁言 |
🎉 功能
随机禁言一名群员或自己n分钟(n通过传入数字然后随机实现),简单粗暴。
👉 命令
随机禁言 或 随禁
命令结构:/随机禁言 [最大禁言时间]
或 /随禁 [最大禁言时间]
(最大禁言时间不填默认60分钟内的随机)
例如:/随机禁言
或 /随禁 10
bot返回内容:
恭喜幸运儿:xxx 获得6分钟的禁言服务
口球 或 禁我
命令结构:/口球 [最大禁言时间]
或 /禁我 [最大禁言时间]
(最大禁言时间不填默认60分钟内的随机)
例如:/口球
或 /禁我 10
bot返回内容:
恭喜您获得6分钟的禁言服务
⚙ 拓展
自行修改源码喵~
📝 更新日志
展开/收起
0.0.1
- 插件初次发布
0.0.2
- 补充插件元信息
- 优化文档
0.0.3
- 新增命令 口球 或 禁我,自己禁自己
0.0.4
- 优化文档
0.0.5
- 新增可以开启任何人都使用随机禁言的配置项
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
Hashes for nonebot_plugin_random_ban-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da6f67c1d0ad3bf23f5890536a1fcd105a0ab87afc53ded5c1894a53d96722e0 |
|
MD5 | cd5d3b61ee67fd273c9fd9857a3647fb |
|
BLAKE2b-256 | fd0a3d136955a79cd4fa80a7c9519c9c1e72f1e703781f69908f81095bcb7202 |
Hashes for nonebot_plugin_random_ban-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f989a8d344247215004947480fb09b0ebe0bedfe5a504be2b0c5ba61b9b21007 |
|
MD5 | 5ffc06d3e7a3222d3b9b9271d9dd1171 |
|
BLAKE2b-256 | 1eaa3f7d6e304dc350b5b79c1b2955003ea70bf61361e730ec6743a4ff447519 |