Call the system command in NoneBot2
Project description
- 以发送消息的方式操作Bot所在环境的系统命令行
- 甚至可以通过此插件
rm
整个服务器 - 限超级用户使用
💿 安装
nb-cli安装, 包管理器安装 二选一
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-system-command
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行,
根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-system-command
pdm
pdm add nonebot-plugin-system-command
poetry
poetry add nonebot-plugin-system-command
conda
conda install nonebot-plugin-system-command
打开 bot项目下的 pyproject.toml
文件,
在其 plugins
里加入 nonebot_plugin_system_command
plugins = ["nonebot_plugin_system_command"]
🎉 使用
指令表
注意
以下命令不可省略前缀 /
- 如果Bot项目的
.env*
里只设置了命令前缀/
, 那么以下命令应该写作//sh
和//cmd
指令 | 权限 | 需要@ | 范围 | 说明 |
---|---|---|---|---|
/sh | 主人 | 否 | 私聊 | 群聊 | Windows环境无法正常使用 |
/cmd | 主人 | 否 | 私聊 | 群聊 | 通用 |
示例
/sh echo "hello world"
/cmd echo "hello world"
TODO
- 使用异步管道
- 命令行交互
⚠️ 注意事项
Don't drink and root!
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
Close
Hashes for nonebot_plugin_system_command-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d16d9a8048487d4efe053b0091f7efbbc2a49c754f3c5eda83a946718dbcae9 |
|
MD5 | 5a2de1786392e621d995d2974aba723e |
|
BLAKE2b-256 | 67a11933fd7ab9fa6e4c7197b3188856247cf4b3b18e0d348a89d8c8d5846767 |
Close
Hashes for nonebot_plugin_system_command-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88483fc224fd4d6317756f3ddade0218b98815dcf9be61e8d12f88a2ec3d9187 |
|
MD5 | e96dc6c1fec5283968475383a0a82c84 |
|
BLAKE2b-256 | a266d33718628e2c0fb3691cbfe793061659ab9c5d393785a42864b38558441c |