Skip to content
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

fix: Don't throw confusing error when using unsuppressed autocomplete in Hybrid Commands #1668

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

silasary
Copy link
Member

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

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

  • Changed throw "Autocomplete is unsupported in hybrid commands." into a warning.

Related Issues

Test Scenarios

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • 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

@silasary silasary requested a review from AstreaTSS April 27, 2024 06:11
@silasary silasary changed the base branch from stable to unstable April 27, 2024 06:11
Copy link
Member

@AstreaTSS AstreaTSS left a comment

Choose a reason for hiding this comment

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

We've talked about this in the contributor chat, but to give a recap: while there is a bug involved with this error because of hybrid command processing happening in an listener that cannot completely stop the bot, and also agree the naming and wording of the variable isn't great, I disagree with this solution.

That being said, I'm not going to stop this PR from being merged (hence commenting instead of requesting changes) - I'm just stating my opinion here. I also recognize alternative solutions get hacky pretty fast, as listeners do suppress errors by their very nature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants