-
-
Notifications
You must be signed in to change notification settings - Fork 89
Command rework, attempt number 2 #558
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
Conversation
After these changes, there's support for multiple interactors with the same name, they just need to be of a different type (slash-command, message context-command, user context-command, or just a basic interactor)
… have to waste another 500 commits like i am right now cause its such a messy and annoying setup
Reviews would be appreciated! The sooner @illuminator3 will stop complaining :p |
TJ-Bot/application/src/main/java/org/togetherjava/tjbot/commands/UserInteractor.java Lines 21 to 22 in ac84310
change the comments, currently it only mentions slash commands add other commands as well TJ-Bot/application/src/main/java/org/togetherjava/tjbot/commands/UserInteractor.java Lines 11 to 12 in ac84310
here also it only mentions about slash command add other commands as well |
application/src/main/java/org/togetherjava/tjbot/commands/system/BotCore.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/BotCommandAdapter.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/system/BotCore.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/UserInteractorPrefix.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/UserInteractorPrefix.java
Outdated
Show resolved
Hide resolved
Order has been modified, the BotCore now only gets created after JDA is ready. Also removed the registerReloadCommand method from BotCore, the reload command has been removed, so that method served no purpose.
The BotCore gets after JDA is ready, because JDA is ready now, routines can be started on construction of BotCore, and commands have access to JDA's caches So now the BotCore constructor is now responsible for reloading commands and scheduling routines
For all the methods that expect a prefix name, the variable has been renamed from name to prefixedName to clarify what it means. Documentation has also been improved across the board.
Also @Zabuzard, if you accept this PR, can it be merged already? |
System has been tested now and should not contain any bugs!
application/src/main/java/org/togetherjava/tjbot/CommandReloading.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/system/CommandProvider.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/system/CommandProvider.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/system/CommandProvider.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application/src/main/java/org/togetherjava/tjbot/Application.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/CommandReloading.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/UserInteractorPrefix.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/UserInteractorPrefix.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/system/BotCore.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/CommandReloading.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/BotCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/UserInteractorPrefix.java
Outdated
Show resolved
Hide resolved
Spotless really is useful, huh? Co-authored-by: Tanish Azad <73871477+Taz03@users.noreply.github.com>
Kudos, SonarCloud Quality Gate passed! |
Changes in this PR
Added interfaces
BotCommand (contains logic for every Discord command)
MessageContextCommand
UserContextCommand
Added adapters
BotCommandAdapter
Added general classes
CommandReloadUtil (reload command has been deleted, commands will be updated automatically every restart)
Renamed
SlashCommandVisibility to CommandVisibility
SlashCommandProvider to CommandProvider
For more info, see #368