Skip to content

Commit dca6db7

Browse files
committed
Rewrite "Types supported by default" of ModalParameterResolver
1 parent ee14870 commit dca6db7

1 file changed

Lines changed: 29 additions & 7 deletions

File tree

BotCommands-core/src/main/kotlin/io/github/freya022/botcommands/api/parameters/resolvers/ModalParameterResolver.kt

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,36 @@ import kotlin.reflect.KType
2424
* Needs to be implemented alongside a [ParameterResolver] subclass.
2525
*
2626
* ### Types supported by default
27-
* - [TextInput] : `String`, when not filled by the user, empty or `null` if the parameter is explicitly nullable
28-
* - [StringSelectMenu] : `String` (can be `null`), `List<String>` (can be empty)
29-
* - [EntitySelectMenu] : [Mentions], `T` (can be `null`) and `List<T>` (can be empty) where `T` is one of:
27+
* **Note:** For `null` to be supported, the parameter must be explicitly nullable.
28+
*
29+
* #### [TextInput]
30+
* - `String` (can be empty, supports `null` when empty)
31+
*
32+
* #### [StringSelectMenu]
33+
* - `String` when a single value can be selected (supports `null` when none selected)
34+
* - `List<String>` (can be empty)
35+
*
36+
* #### [EntitySelectMenu]
37+
* - [Mentions]
38+
* - `T` (supports `null` when none selected)
39+
* - `List<T>` (can be empty)
40+
*
41+
* Where `T` is one of:
3042
* [IMentionable], [Role], [User], [InputUser], [Member], [GuildChannel]
31-
* - [AttachmentUpload] : `List` of [Message.Attachment], can be empty, [Message.Attachment]
32-
* - [RadioGroup] : `String`, `null` when none selected
33-
* - [CheckboxGroup] : `List<String>`, can be empty
34-
* - [Checkbox] : (primitive)`Boolean`
43+
*
44+
* #### [AttachmentUpload]
45+
* - `List` of [Message.Attachment] (can be empty)
46+
* - [Message.Attachment] (supports `null` when none selected)
47+
*
48+
* #### [RadioGroup]
49+
* - `String` (supports `null` when none selected)
50+
*
51+
* #### [CheckboxGroup]
52+
* - `List<String>` (can be empty)
53+
* - `String` when a single value can be selected
54+
*
55+
* #### [Checkbox]
56+
* - (primitive) `Boolean`
3557
*
3658
* @param T Type of the implementation
3759
* @param R Type of the returned resolved objects

0 commit comments

Comments
 (0)