fix: Don't throw confusing error when using unsuppressed autocomplete in Hybrid Commands #1668
+2
−1
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.
Pull Request Type
Description
I wasted far too much time trying to figure out why my hybrid commands didn't have any options defined, and ignored the "Autocomplete doesn't work on text commands" message because I wasn't even getting as far as having options to autocomplete.
It was only when I dug far too much into the code that I realized that the "warning" there was effectively removing all parameters from my command (in both Slash and Prefixed modes), that I figured out that I needed to pass
_silence_autocomplete_errors=True
, something that A) is a private parameter, and B) implies that it hides the message but otherwise doesn't change behaviour.This PR makes the combination of
autocomplete=True, _silence_autocomplete_errors=False
behave the way I expected it to.Changes
throw "Autocomplete is unsupported in hybrid commands."
into a warning.Related Issues
Test Scenarios
Python Compatibility
3.10.x
3.11.x
Checklist
pre-commit
code linter over all edited files