https://github.com/nonepkg/plugin-manager
Premium Nonebot Plugin Manager base on import hook
https://github.com/nonepkg/plugin-manager
nonebot
Last synced: 6 months ago
JSON representation
Premium Nonebot Plugin Manager base on import hook
- Host: GitHub
- URL: https://github.com/nonepkg/plugin-manager
- Owner: nonepkg
- License: mit
- Created: 2021-03-07T06:31:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-10-06T19:05:59.000Z (9 months ago)
- Last Synced: 2025-10-30T12:39:12.537Z (8 months ago)
- Topics: nonebot
- Language: Python
- Homepage:
- Size: 298 KB
- Stars: 74
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Premium Nonebot Plugin Manager
[NoneBot 2](https://github.com/nonebot/nonebot2) 的**非侵入式**插件管理器
[](LICENSE)



## 安装
*插件重写中,之前版本的问题不再回复。*
### 从 PyPI 安装(推荐)
- 使用 nb-cli
```bash
nb plugin install nonebot-plugin-manager
```
- 使用 pdm
```bash
pdm add nonebot-plugin-manager
```
### 从 GitHub 安装(不推荐)
```bash
pdm add git+https://github.com/nonepkg/plugin-manager
```
## 使用
### 命令
**使用前请先确保命令前缀为空,否则请在以下命令前加上命令前缀 (默认为`/`)。**
- `npm block/disable `禁用插件(需要权限)
- `plugin ...`必选参数,需要禁用的插件名
- `-a, --all`可选参数,全选插件
- `-r, --reverse`可选参数,反选插件
- `-u , --user `可选参数,管理指定用户设置(仅超级用户可用)
- `-g , --group `可选参数,管理指定群设置(仅超级用户可用)
- [ ] `-s|--scope`
- `npm unblock/enable `启用插件(需要权限)
- `plugin ...`必选参数,需要禁用的插件名
- `-a, --all`可选参数,全选插件
- `-r, --reverse`可选参数,反选插件
- `-u , --user `可选参数,管理指定用户设置(仅超级用户可用)
- `-g , --group `可选参数,管理指定群设置(仅超级用户可用)
- [ ] `npm ban `
- [ ] `npm unban `
user :ms.at or platform/id
## 原理
使用`run_preprocessor`装饰器,在 Matcher 运行之前检测其所属的 Plugin 判断是否打断。
事实上 Nonebot 还是加载了插件,所以只能算是**屏蔽**而非**卸载**。
## TODO
- [ ] 新的权限管理
- [ ] 提供自动授予群管理员群内 write 权限的配置项
## 缺陷
- 无法停用 Matcher 以外的机器人行为(如 APScheduler )