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

feat: allow passing autocompleters that take a cog as first argument to commands.Param #1269

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Sharp-Eyes
Copy link
Member

Summary

Currently, commands.Param assumes the provided autocompleter does not take a cog and is typehinted as such, despite somewhat working with alternative autocomplete options such as a simple sequence.

This PR ensures cog-based autocompleters work with commands.Param.
The typehint is changed to work with any valid autocompleter (callback without cog, callback with cog, sequence), and callbacks are internally marked so that slash commands handle them correctly.

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running pdm lint
    • I have type-checked the code by running pdm pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@Sharp-Eyes Sharp-Eyes changed the title faet: allow passing autocompleters that take a cog as first argument to commands.Param feat: allow passing autocompleters that take a cog as first argument to commands.Param Jan 3, 2025
@shiftinv shiftinv added the t: enhancement New feature label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: enhancement New feature
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants