Skip to content

Commit

Permalink
Update README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
ssttkkl authored Dec 10, 2022
1 parent 2569168 commit 793d88a
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,33 @@ _✨ Nonebot 权限控制 ✨_
- `<插件名>`:对整个插件进行开关
- `<插件名>.<子服务名>.<子服务名>.....<子服务名>`:对插件内的某个子服务进行开关(需参照下文对插件进行配置)

### 示例

假设bot加载了内置插件echo

```python
nonebot.load_builtin_plugins("echo")
```

执行下面的指令后,用户12345678将无法调用指令`/echo`

```
/ac subject onebot:12345678 deny service echo
```

执行下面的指令后,群组87654321的所有用户(用户12345678除外)将无法调用指令`/echo`

```
/ac subject onebot:12345678 allow service echo
/ac subject onebot:g87654321 deny service echo
```

执行下面的指令后,所有用户将无法调用指令`/echo`

```
/ac subject all deny service echo
```

## 插件适配

完整代码:[src/nonebot_plugin_ac_demo](src/nonebot_plugin_ac_demo)
Expand Down Expand Up @@ -162,4 +189,4 @@ async def _(matcher: Matcher):
```
/ac subject onebot:g87654321 deny service nonebot_plugin_ac_demo
/ac subject onebot:g87654321 allow service nonebot_plugin_ac_demo.c
```
```

0 comments on commit 793d88a

Please sign in to comment.