In this case, trying to use <prefix>msg would not make the bot respond. The hybrid manager was just ignoring any commands without a callback or that were only meant as a jumping point for subcommands, meaning it would never read the aliases from them.
For the first part, this PR properly parses these types of commands (and makes it so it doesn't add improper aliases for base commands). However, this introduced a new problem - the command hooks were run after an empty callback check, which means that the above example would still not properly get parsed. That was fixed by moving the hook above the callback check.
Changes
Parse and use aliases from "empty" base commands.
Don't add subcommand aliases as aliases to base command.
Move add command hook logic above the callback check.
Related Issues
Test Scenarios
See example above.
Python Compatibility
[x] I've ensured my code works on Python 3.10.x
[ ] I've ensured my code works on Python 3.11.x
Checklist
[x] I've run the pre-commit code linter over all edited files
[x] I've tested my changes on supported Python versions
[ ] I've added tests for my code, if applicable
[ ] I've updated / added documentation, where applicable
Pull Request Type
Description
Previously, aliases like the below wouldn't be properly registered for the prefixed command variant of hybrid commands:
In this case, trying to use
<prefix>msg
would not make the bot respond. The hybrid manager was just ignoring any commands without a callback or that were only meant as a jumping point for subcommands, meaning it would never read the aliases from them.For the first part, this PR properly parses these types of commands (and makes it so it doesn't add improper aliases for base commands). However, this introduced a new problem - the command hooks were run after an empty callback check, which means that the above example would still not properly get parsed. That was fixed by moving the hook above the callback check.
Changes
Related Issues
Test Scenarios
See example above.
Python Compatibility
3.10.x
3.11.x
Checklist
pre-commit
code linter over all edited files