Skip to content

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

Merged
merged 32 commits into from
Sep 30, 2022
Merged

Command rework, attempt number 2 #558

merged 32 commits into from
Sep 30, 2022

Conversation

Tais993
Copy link
Member

@Tais993 Tais993 commented Sep 3, 2022

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

@Tais993 Tais993 added documentation Improvements or additions to documentation enhancement New feature or request priority: major labels Sep 3, 2022
@Tais993 Tais993 self-assigned this Sep 3, 2022
@Tais993 Tais993 requested review from a team as code owners September 3, 2022 13:30
@Tais993 Tais993 marked this pull request as draft September 3, 2022 13:30
@Taz03 Taz03 linked an issue Sep 4, 2022 that may be closed by this pull request
14 tasks
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)
@Tais993 Tais993 marked this pull request as ready for review September 7, 2022 13:50
@Tais993
Copy link
Member Author

Tais993 commented Sep 8, 2022

Reviews would be appreciated! The sooner @illuminator3 will stop complaining :p

@Taz03
Copy link
Member

Taz03 commented Sep 10, 2022

* Requirements for this are documented in
* {@link net.dv8tion.jda.api.interactions.commands.build.Commands#slash(String, String)}.

change the comments, currently it only mentions slash commands add other commands as well


* Represents a feature that can interact with users. The most important implementation is
* {@link SlashCommand}.

here also it only mentions about slash command add other commands as well

@java-coding-prodigy
Copy link
Contributor

This branch needs to be updated in accordance with #541 and #548

@Tais993 Tais993 requested a review from Zabuzard September 27, 2022 11:54
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.
@Tais993 Tais993 requested a review from Zabuzard September 29, 2022 11:17
@Tais993
Copy link
Member Author

Tais993 commented Sep 29, 2022

Also @Zabuzard, if you accept this PR, can it be merged already?
Hasn't been much interest in anyone else accepting the PR, so I much rather don't want to wait a full week.

Documentation changes
Added MAX_COMMAND_COUNT constant to CommandReloading

And our beloved friend, spotless :p
@Tais993 Tais993 requested a review from Zabuzard September 30, 2022 10:15
Zabuzard
Zabuzard previously approved these changes Sep 30, 2022
Copy link
Member

@Zabuzard Zabuzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Spotless really is useful, huh?

Co-authored-by: Tanish Azad <73871477+Taz03@users.noreply.github.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Tais993 Tais993 merged commit 0d315c8 into develop Sep 30, 2022
@Tais993 Tais993 deleted the feature/command-rework branch September 30, 2022 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request priority: major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rework command system to add context command and autocomplete support
5 participants