Closed brandan-schmitz closed 3 years ago
Hi, thanks for the suggestion. At least it showed that even with 100 % unit test coverage and 100 % mutant coverage there are still untested cases. Because besides not adding doku or tests, you actually changed the semantics of the regex to remove it anywhere in the string and not only as prefix or suffix.
I can add the respective test and docu changes.
Just in case you didn't see, you can use @Alias
annotation or an overwritten getAliases()
method to define the aliases for commands.
So you could also easily have a BaseCommand
class which all your commands extend that does the logic you want in its implementation.
Can you maybe provide some example project with Quarkus? I'm curious how that looks and works but have no experience with Quarkus. Maybe I'll add a Quarkus-based example ping bot to the examples then too.
Sorry for not adding those tests and docu changes. I sometimes forget to do those when just trying to get something working.
I will send a link for a example project I can throw together sometime this weekend for ya. I did try the @alias
but was getting the same issue where it was not recognizing the command. I did not have time to trace down that issue as of yet.
There are a few other quirks when using Quarkus, such as the way it looks for CDI beans, the application fails if you do not have both Javacord and JDA as dependencies. A thought I had in that is breaking each thing into sub-modules in a way where you would have the core library, then an additional command-framework-javacord
or command-framework-jda
module that would bring in items related to each library if you are using it. But that can be opened and discussed in a separate issue.
I am closing as there are too many issues caused by the way Quarkus has written their own implementation of CDI that it practically would require this project to be re-written for use with Quarkus specifically.
Hey @brandan-schmitz, I'm still interested in an example project where you try to get it running with Quarkus. It's ok if it is not working, just as far as you got. I'm actually changing a few things that are not CDI conform but unintentionally Weld specific, maybe that already will fix some of the issues you had.
When being used in Quarkus, the class name is returned with
_Subclass
appended to the name. This causes the command to not be found. This adds a section to the replaceAll regex to remove the_Subclass
from the string.