Skip to content

Commit

Permalink
feat(discord): improve kord permission docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Citymonstret committed Jan 18, 2024
1 parent 4226fe4 commit 513845f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/discord/kord.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,21 @@ public suspend void yourCommand() { /* ... */ }

### Permissions

You may set the default permissions by using `DiscordPermission.of(Long)` as the command permission. Example:
You may set the default permissions of the command using `Command.Builder.permissions(Permissions)` or
`MutableCommandBuilder.permissions(Permissions)` using an instance of Kord's `Permissions` class:

```kotlin
commandBuilder.permission(1337)
commandManager.buildAndRegister("command") {
// Using a permissions builder
permissions(Permissions(Permission.Administrator))

// Using the vararg overload
permissions(Permission.Administrator)
}
```

You may use ordinary permissions by setting the permission function in `KordCommandManager`.
This will not hide the commands from the users, so you must do that manually through the server settings.

### Settings

Expand Down

0 comments on commit 513845f

Please sign in to comment.