XDbot2 SUDO 插件独立版
Project description
📖 介绍
XDbot2 SUDO 插件独立版,允许使用其他用户身份执行命令
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-sudo
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-sudo
pdm
pdm add nonebot-plugin-sudo
poetry
poetry add nonebot-plugin-sudo
conda
conda install nonebot-plugin-sudo
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_sudo"]
⚙️ 配置
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
SUDOERS |
是 | 无 | 可以使用 sudo 指令的用户 |
SUDO_INSERT_CMDSTART |
否 | 0 |
是否自动插入指令前缀 |
SUDO_REPLACE_SENDER_DATA |
否 | 1 |
是否修改event.sender的信息(可能会拖慢运行速度) |
🎉 使用
仅在 Onebot V11 适配器下测试可用,暂不支持 sudo 嵌套
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
sudo <uin> <消息...> |
SUDOER | 否 | 无限制 | 以用户<uin>的身份执行<消息...> |
效果图
待补充
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_sudo-1.0.6.tar.gz.
File metadata
- Download URL: nonebot_plugin_sudo-1.0.6.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e93704e8405ea1537d398de4f51ec33a56e9e409904e4368cc1a7fef99e9141
|
|
| MD5 |
5a4fcd4f019c01b831e0b94c7b972a40
|
|
| BLAKE2b-256 |
5a4a318230b2fc690c0f44713802e62f1dfd36f162c07be14f037ee122cef74b
|
File details
Details for the file nonebot_plugin_sudo-1.0.6-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_sudo-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
566845c41833c7f8df616ca06b5e103fe0b3fc17eb99804d460e8a20efa13e2b
|
|
| MD5 |
f6b9527a326ffd5c67097b960147394f
|
|
| BLAKE2b-256 |
3b3e77f2b434ccf780291ad77730603f492000552d6e06c6d511f44f95841cb2
|