Skip to content

Commit

Permalink
very extensive component documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Citymonstret committed Dec 21, 2023
1 parent b67cdda commit b7bcb51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,21 @@ in a type-safe manner.

##### Required

You can create a required variable component either by using `CommandComponent.Builder.required()` or any
of the many different overloaded `required` factory methods in `Command.Builder`.

##### Optional

You can create a required variable component either by using `CommandComponent.Builder.optional()` or any
of the many different overloaded `optional` factory methods in `Command.Builder`.

When creating an optional variable component you may supply a default value. The default value will be used in the case
that the user has not supplied any input for the component. There are three different types of default values:

- **DefaultValue.constant(Value)**: A constant default value.
- **DefaultValue.dynamic(Function)**: A dynamic value that is evaluated when the command is parsed.
- **DynamicValue.parsed(String)**: A string that is parsed by the component parser when the command is parsed.

##### Component pre-processing

You may attach pre-processors to your command components, either when building the component or after it has been built.
Expand Down

0 comments on commit b7bcb51

Please sign in to comment.