Skip to content

Commit c37dccb

Browse files
committed
feat(docs): add further usage for requirements api
1 parent 5523e36 commit c37dccb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

saltify-docs/content/docs-core/command.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ Requirements 是一个用于指令鉴权的语法,妥当使用可以减少很
113113

114114
```kotlin
115115
client.command("stop") {
116-
require { user(3650502250, 3521766148) }
117-
116+
require { user(3650502250, 3521766148) + group(570335215) }
117+
118118
onExecute {
119119
@OptIn(DelicateCoroutinesApi::class)
120120
GlobalScope.launch {
@@ -133,3 +133,7 @@ fun SaltifyCommandRequirementContext.user(vararg targetId: Long) =
133133
context.event.data.senderId in targetId
134134
}
135135
```
136+
137+
> [!TIP]
138+
>
139+
> 在 require 块内,还可以通过 `or` `and` `not` 拼接 requirements!

0 commit comments

Comments
 (0)