-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix interactions for forms feature #538
Merged
HopeBaron
merged 15 commits into
kordlib:feature/forms
from
lukellmann:feature/forms-interactions
Feb 19, 2022
Merged
Fix interactions for forms feature #538
HopeBaron
merged 15 commits into
kordlib:feature/forms
from
lukellmann:feature/forms-interactions
Feb 19, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lukellmann
changed the title
Fix interaction mess for forms feature
Fix interactions for forms feature
Feb 15, 2022
HopeBaron
approved these changes
Feb 17, 2022
core/src/main/kotlin/behavior/interaction/ActionInteractionBehavior.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # core/src/main/kotlin/entity/interaction/ActionInteraction.kt # core/src/main/kotlin/entity/interaction/GlobalInteraction.kt
Merged
Additional changes in the commits after @HopeBaron's review:
|
HopeBaron
added a commit
that referenced
this pull request
Feb 20, 2022
* Initial modals implementation You can already receive modals via the gateway and send modals via REST * Change the "DiscordComponent" model to multiple classes due to buttons and text inputs sharing the same field name * Canonical order * Use two ***DiscordComponents classes for everything * Rename the classes because it looks better this way * Revert core changes * Implement text input component classes in the core module * Fix TextInput component type deserialization * improve the interaction tree * More changes to the tree * remove unresolved references * add core events * Apply suggestions from code review Co-authored-by: Lukellmann <[email protected]> * change compontents top level to ActionRowBuilder Co-authored-by: Lukellmann <[email protected]> * refactor files * refactor interaction files * refactor response files * refactor followup messages * add TextInputComponent list retrival property * fix withStrategy return type * Apply suggestions from code review Co-authored-by: Lukellmann <[email protected]> * rename discord modal component to DiscordTextInputComponent * fix interaction response type * Forms support adjustments (#534) * return types * sealed InteractionResponseBehavior * ClosedRange<Int> instead of IntRange * rename file * GuildAutoCompleteInteraction is GuildInteraction (#535) * required is true by default for text inputs (#537) * rewrite a safer OptionValue implementation * Apply code review suggestions * Yeet out IntOptionValue * Fix interactions for forms feature (#538) * move MessageInteraction into Message * interactions * clarify why ComponentInteractionBehavior is no ModalParentInteractionBehavior * typo * rename ApplicationCommandInteractionInteractionCreateEvent to ApplicationCommandInteractionCreateEvent * move ResolvedObjects * attachments in InteractionCommand * fix InteractionCommand.filterOptions() * Entity in mentionables again * move duplicate code to InteractionCommand * ActionRowComponent docs * rename acknowledge * maps for components * cleanup and consider feedback in codereview * reintroduce CommandArgument convience methods Co-authored-by: MrPowerGamerBR <[email protected]> Co-authored-by: Lukellmann <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ModalSubmitInteraction
aComponentInteractionBehavior
(it can also edit the original message if the modal was created from e.g. a button press), can only be used ifmessage
is present on theModalSubmitInteraction
ModalParentInteractionBehavior
as a supertype ofApplicationCommandInteractionBehavior
andComponentInteraction
(notComponentInteractionBehavior
) that has themodal
function as a response to the interactionComponentInteractionBehavior
, it is no longer true, visibility can be chosen for every followup individuallyComponentInteractionBehavior
and replace with new ones with more accurate names (public/ephemeral as adjective for message not acknowledgement: e.g. nowacknowledgeDeferredPublicMessageUpdate
instead of oldacknowledgePublicDeferredMessageUpdate
)AutoCompleteInteractionBehavior
now extendsDataInteractionBehavior
withStrategy
to have the right return type for every interactioninvokedCommandId
andinvokedCommandName
properties toApplicationCommandInteraction
commandId
andcommandName
toAutoCompleteInteraction
MessageInteraction
(the data object that is included in messages that are a response to an interaction, they are not interactions that create an event) fromdev.kord.core.entity.interaction
intoMessage
as a nested class and rename it toInteraction
, it was easy to confuse it withMessageCommandInteraction
UnknownApplicationCommandInteraction
andUnknownComponentInteraction
: if kord doesn't know about a command type or component type it can not create them in the first place so there will not be an interaction created for them,UnknownApplicationCommandInteraction
also wasn't used at allApplicationCommandInteractionInteractionCreateEvent
toApplicationCommandInteractionCreateEvent
ephemeral
fromUpdateMessageInteractionResponseCreateBuilder
: the visibility of an existing message can not be changed by that builderequals
,hashCode
andtoString
implementations for all interactions