Skip to content

Commit

Permalink
feat: allow cog-based autocompleters in commands.Param
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharp-Eyes committed Jan 3, 2025
1 parent d847f50 commit 9728d40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion disnake/ext/commands/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,11 @@ def __init__(
self.param_name: str = self.name
self.converter = converter
self.convert_default = convert_default

if autocomplete:
classify_autocompleter(autocomplete)
self.autocomplete = autocomplete

self.choices = choices or []
self.type = type or str
self.channel_types = channel_types or []
Expand Down Expand Up @@ -1121,7 +1125,7 @@ def Param(
choices: Optional[Choices] = None,
converter: Optional[Callable[[ApplicationCommandInteraction[BotT], Any], Any]] = None,
convert_defaults: bool = False,
autocomplete: Optional[Callable[[ApplicationCommandInteraction[BotT], str], Any]] = None,
autocomplete: Optional[AnyAutocompleter] = None,
channel_types: Optional[List[ChannelType]] = None,
lt: Optional[float] = None,
le: Optional[float] = None,
Expand Down

0 comments on commit 9728d40

Please sign in to comment.