-
Notifications
You must be signed in to change notification settings - Fork 12
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
Refactor/definition #149
Merged
Merged
Refactor/definition #149
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
Kaktushose
approved these changes
Jan 5, 2025
Kaktushose
added a commit
that referenced
this pull request
Jan 7, 2025
* remove obsolete methods in PermissionsProvider * fix modal defaultValue not being set * add option to link runtimeId for message builder components * improve builder components methods * properly escape string replacements * bump jda version and fix reply bug [#137] * fix unit tests * update JsonErrorMessageFactory to use new executionFailed embed format * fix guild commands not registering * fix guild commands not registering * improve documentation * Bump to java 23 and refactoring (#140) * Refactor part of reflect package and JDACommands.java * fix compile errors and unit tests * fix incorrect java version in ci * bump jacoco version * remove isActive functionality * fix auto complete dispatching * move parameter validation to helper methods * Make AutoCompleteDefinition and SlashCommandDefinition immutable * Refactor tree * fix unit tests * make getComponent methods accessible again * fix CommandTree printing * remove unnecessary generic type from GenericEvent * fix unit tests * unify functional interfaces * refactor reply * change Helpers class and fix unit tests * formatting * formatting --------- Co-authored-by: Kaktushose <[email protected]> * [REFACTOR] Internal dispatching flow and reply API (#141) * first pass on VirtualThread refactor * refactor CommandDispatcher * prepare Dispatchers for refactoring and reimplement AutoCompleteDispatcher * Make Runtime closeable * Add Event abstraction over jda and EventHandlers for command and autocomplete * introduce new ExecutionContext and simplify CommandHandler * Use new ExecutionContext in middleware and adapters, restructure EventHandler * Delete JDa Event wrapper * remove CommandExecutionContext.java and remove context from type adapting flow * delete old files * fix type errors * move method invoke to definition classes * Move classes out of refactor sub package * Refactor ExecutionContext and stuff * fix wrong middleware priority * Add KeyValueStore and missing package-info.java files * Add KeyValueStore and missing package-info.java files * Fix double method arguments * Reduce generics complexity * Refactor MiddlewareRegistry * Split ExecutionContext.java * refactor event classes and reply logic * fix middleware order bug * make components attachable again * reimplement replyModal * first pass on ButtonHandler * seal EventHandler * seal EventHandler * Merge InvocationContext and Invocation * refactor reply api * Add getter for JDA Events in Event * make "No interaction found" error message less ambiguous * Refactor reply system (#142) * make reply methods return Message object and reimplement keep components * remove latest reply from runtime * replace ephemeral boolean flag with ReplyConfig and introduce GlobalReplyConfig * write unit tests for new ReplyConfig helper method and fix old unit tests * simplify switch * Hopefully fix middleware priorities * Move HandlerContext out of InvocationContext * Move InstanceSupplier out of InvocationContext * bump code * Explicitly state dispatching user api * Yes.. * fully implement modals and components * first pass on static components * Fix static components, refactor component reply * improve error handling * Remove unused method * Add docs for context, handling and Runtime * fix custom id bugs * write documentation * more documentation and simplify component reply * even more documentation * even more documentation * formatting * add missing method * fix component bug * more documentation * small docs fix * Add logging for EventHandler, JDAEventListener and Runtime * Add ExpirationStrategy * stuff * refactor package structure * add docs for ExpirationStrategy * Expose dispatching package * Add jda javadoc reference to maven java doc plugin * Update src/main/java/com/github/kaktushose/jda/commands/annotations/interactions/Interaction.java Co-authored-by: Nick Hensel <[email protected]> * Update src/main/java/com/github/kaktushose/jda/commands/annotations/Implementation.java Co-authored-by: Nick Hensel <[email protected]> * Update src/main/java/com/github/kaktushose/jda/commands/dispatching/events/ReplyableEvent.java Co-authored-by: Nick Hensel <[email protected]> * Update src/main/java/com/github/kaktushose/jda/commands/dispatching/reply/MessageReply.java Co-authored-by: Nick Hensel <[email protected]> * Update src/main/java/com/github/kaktushose/jda/commands/dispatching/handling/EventHandler.java Co-authored-by: Nick Hensel <[email protected]> * improve docs * remove generic in getSelectMenu * rename Components to Component * update documentation * update documentation * update lastActivity * Add flowchart picture and introduce javadoc directory * resolve review * Add examples --------- Co-authored-by: Nick Hensel <[email protected]> Co-authored-by: Nick Hensel <[email protected]> * Update coverage.yml to use java 23 (#151) * Refactor definition building (#149) * first pass on new definition api * make interaction interfaces records and first pass on new registry * update records * fix invocation context * add missing parameter methods * rename * add reflection wrapper * add reflective descriptor * update definitions * update definitions * fix shit ton of compile errors * cleanup * formatting * remove since tag * update documentation * fix unit tests * extract reflections out of InteractionRegistry * Use Iterable instead of List and introduce CustomId#independent * Restructure Definitions package and separate Context and SlashCommand * remove Permissions feature interface * Forbid Definition#invoke by user and fix bug in CustomID * javadocs * Yeah.. * docs * more javadoc * formatting * fix java tests * fix java tests * fix wrong annotation * fix codacy * small changes --------- Co-authored-by: Kaktushose <[email protected]> Co-authored-by: Kaktushose <[email protected]> * add common ErrorContext for error messages * rename ParameterDefinition to OptionDataDefinition and fix bug in ConstraintMiddleware * fix optional argument handling in type adapting * remove components when interaction execution fails * remove varargs from Component * update examples * bump JDA version and update readme * Introduce builder and refactor registry handling (#150) * Add builder and move some registries to internal * Add docs and remove unnecessary methods * a * Fix merge conflict * Things * Clean up Registries * Rename registries * Add docs * Fix tests * Fix list * Add global reply config * fix unit tests * stuff * Add additionally docs, expose ClassFinder default implementations via static methods and make Descriptions fully immutable * Fix merge conflicts * Make org.jetbrains.annotations transitive * Add @NotNull * Fix constraint parameter types * Resolve review * fix unit tests --------- Co-authored-by: Kaktushose <[email protected]> * fix primitive type handling * Update javadocs workflow to support multiple versions (#153) * update workflow * update workflow * use aggregate goal instead of javadoc * add java setup * update workflows * update workflow * update workflow * update workflow * update workflow * add legacy branch creation * test * test final * clean up --------- Co-authored-by: Nick Hensel <[email protected]> * prepare release --------- Co-authored-by: Nick Hensel <[email protected]> Co-authored-by: Nick Hensel <[email protected]> Co-authored-by: Finn | Sachsenspielt <[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.
closes #144