JDA-Utilities
JDA-Utilities copied to clipboard
Experimental - Cancel-able Menus
Pull Request
Pull Request Checklist
Please follow the following steps before opening this PR.
PRs that do not complete the checklist will be subject to denial for
missing information.
- [x] I have checked the pull request page for upcoming or merged features/bug fixes.
- [x] I have read JDA's contributing guidelines.
Pull Request Information
Check and fill in the blanks for all that apply:
- [ ] My PR fixes a bug, error, or other issue with the library's codebase.
- [x] My PR is for the
menu
andcommons
modules of the JDA-Utilities library. - [ ] My PR creates a new module for the JDA-Utilities library:
______
.
Description
This module adds the possibility to cancel EventWaiter
tasks via the new return value of EventWaiter#waitForEvent
(Future<Void>
)
This new feature is used to add Menu#cancel()
to cancel menus that are already running.
Todo:
- [ ] Discuss if this is the proper way of doing this or if some mechanics should be changed
- [x] Javadocs
- [x] Decide how to handle
cancelFuture.cancel(true)
vsfalse
- [ ] Should there be a cancel method that doesn't execute the cancel/final action? What about the EventWaiter cancellation?
- [ ] Eventually throw errors on
display()
if already being displayed somewhere, as this would currently prevent proper functionality ofMenu#cancel()
- [ ] Wait for PR #58 to be merged and patch it as well in this PR
- [ ] Extensive testing
- [ ] Final review
Should probably also wait for #58 to be merged so i can apply the changes from this PR to that code as well. Adding it to the TODO