Commit c4299db
Implement RadioGroup, CheckboxGroup, and Checkbox modal components (#138)
* Implement new modal components: RadioGroup, CheckboxGroup, Checkbox
This commit introduces support for the new Discord components: Radio Group, Checkbox Group, and Checkbox.
Key changes:
- Added `ComponentType` enum values for `RadioGroup`, `CheckboxGroup`, and `Checkbox`.
- Created JSON models for local and modal (transient) representations of these components.
- Implemented `LocalComponent` classes (`LocalRadioGroupComponent`, `LocalCheckboxGroupComponent`, `LocalCheckboxComponent`) for constructing these components.
- Implemented `IModalComponent` interfaces and `TransientModalComponent` classes for handling received components in modal submissions.
- Updated `LocalComponent.ToModel()` to serialize the new components properly.
- Updated `BindValues` command execution step to support parameter binding for these new component types in modal commands.
Co-authored-by: Quahu <24848652+Quahu@users.noreply.github.com>
* Implement new modal components: RadioGroup, CheckboxGroup, Checkbox
This commit introduces support for the new Discord components: Radio Group, Checkbox Group, and Checkbox.
Key changes:
- Added `ComponentType` enum values for `RadioGroup`, `CheckboxGroup`, and `Checkbox`.
- Created JSON models for local and modal (transient) representations of these components.
- Implemented `LocalComponent` classes (`LocalRadioGroupComponent`, `LocalCheckboxGroupComponent`, `LocalCheckboxComponent`) for constructing these components.
- Implemented `IModalComponent` interfaces and `TransientModalComponent` classes for handling received components in modal submissions.
- Updated `LocalComponent.ToModel()` to serialize the new components properly.
- Updated `BindValues` command execution step to support parameter binding for these new component types in modal commands.
- Added fluent builder extension methods for the new local components.
Co-authored-by: Quahu <24848652+Quahu@users.noreply.github.com>
* Implement new modal components: RadioGroup, CheckboxGroup, Checkbox
This commit introduces support for the new Discord components: Radio Group, Checkbox Group, and Checkbox.
Key changes:
- Added `ComponentType` enum values for `RadioGroup`, `CheckboxGroup`, and `Checkbox`.
- Created JSON models for local and modal (transient) representations of these components.
- Implemented `LocalComponent` classes (`LocalRadioGroupComponent`, `LocalCheckboxGroupComponent`, `LocalCheckboxComponent`) for constructing these components.
- Implemented `IModalComponent` interfaces and `TransientModalComponent` classes for handling received components in modal submissions.
- Updated `LocalComponent.ToModel()` to serialize the new components properly.
- Updated `BindValues` command execution step to support parameter binding for these new component types in modal commands.
- Added fluent builder extension methods for the new local components.
- Ensured consistency with existing component patterns, including usage of `Optional<T>` and generic extension methods.
Co-authored-by: Quahu <24848652+Quahu@users.noreply.github.com>
* Implement new modal components: RadioGroup, CheckboxGroup, Checkbox
This commit introduces full support for the new Discord modal components: Radio Group, Checkbox Group, and Checkbox.
Key changes:
- Added `ComponentType` enum values for `RadioGroup`, `CheckboxGroup`, and `Checkbox`.
- Created JSON models for local and modal (transient) representations of these components.
- Implemented `LocalComponent` classes (`LocalRadioGroupComponent`, `LocalCheckboxGroupComponent`, `LocalCheckboxComponent`) and their option classes.
- Implemented `IModalComponent` interfaces and `TransientModalComponent` classes.
- Updated `LocalComponent.ToModel()` to serialize the new components properly, using `OptionalGuard` for validation.
- Updated `ModalComponentConverter` to handle polymorphic deserialization of the new component types.
- Updated `BindValues` command execution step to support parameter binding for these new component types in modal commands.
- Added fluent builder extension methods and static factory methods (`LocalComponent.RadioGroup`, etc.).
- Ensured correct use of `Optional<IList<T>>` for option lists and removed unsupported `Emoji` properties from options.
Co-authored-by: Quahu <24848652+Quahu@users.noreply.github.com>
* Implement new modal components: RadioGroup, CheckboxGroup, Checkbox
This commit fully implements support for the new Discord modal components: Radio Group, Checkbox Group, and Checkbox.
Key changes:
- Added `ComponentType` enum values for `RadioGroup`, `CheckboxGroup`, and `Checkbox`.
- Created JSON models for local and modal (transient) representations of these components.
- Implemented `LocalComponent` classes (`LocalRadioGroupComponent`, `LocalCheckboxGroupComponent`, `LocalCheckboxComponent`) and their option classes.
- Implemented `IModalComponent` interfaces and `TransientModalComponent` classes for receiving modal submissions.
- Updated `LocalComponent.ToModel()` to serialize the new components properly, using `OptionalGuard` for validation.
- Updated `ModalComponentConverter` to handle polymorphic deserialization of the new component types.
- Updated `BindValues` command execution step to support parameter binding for these new component types in modal commands.
- Added fluent builder extension methods and static factory methods (`LocalComponent.RadioGroup`, etc.).
- Ensured correct use of `Optional<IList<T>>` for option lists and removed unsupported `Emoji` properties from options.
- Added `Label` support for Checkbox (optional).
Co-authored-by: Quahu <24848652+Quahu@users.noreply.github.com>
* Remove label from Checkbox factory method
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent e20e7ce commit c4299db
File tree
30 files changed
+1034
-296
lines changed- src
- Disqord.Bot/Commands/Implementation/Components/ExecutionSteps
- Disqord.Core
- Entities
- Core/Interactions/Components/Modal
- Local/Interaction/Components
- Extensions
- V2
- Transient/Interactions/Components/Modal
- Enums/Interactions/Components
- Models/Interactions/Components
- Modal
- V2
- Serialization/Json/Default/Entities/Converters
30 files changed
+1034
-296
lines changedLines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
193 | 207 | | |
194 | 208 | | |
195 | 209 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
163 | 183 | | |
0 commit comments