Skip to content

Commit e9efa2c

Browse files
Blue-Robin-Takenpre-commit-ci[bot]plun1331LulalabyNeloBlivion
authored
docs: fix incorrect documentation about discord.Option.autocomplete (#2265)
Signed-off-by: Blue-Robin-Taken <[email protected]> Signed-off-by: Lala Sabathil <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: plun1331 <[email protected]> Co-authored-by: Lala Sabathil <[email protected]> Co-authored-by: NeloBlivion <[email protected]>
1 parent 741851b commit e9efa2c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

discord/commands/options.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ class Option:
141141
max_length: Optional[:class:`int`]
142142
The maximum length of the string that can be entered. Must be between 1 and 6000 (inclusive).
143143
Only applies to Options with an :attr:`input_type` of :class:`str`.
144-
autocomplete: Optional[:class:`Any`]
145-
The autocomplete handler for the option. Accepts an iterable of :class:`str` or :class:`OptionChoice`, a callable (sync or async)
146-
that takes a single argument of :class:`AutocompleteContext`, or a coroutine.
147-
Must resolve to an iterable of :class:`str` or :class:`OptionChoice`.
144+
autocomplete: Optional[Callable[[:class:`.AutocompleteContext`], Awaitable[Union[Iterable[:class:`.OptionChoice`], Iterable[:class:`str`], Iterable[:class:`int`], Iterable[:class:`float`]]]]]
145+
The autocomplete handler for the option. Accepts a callable (sync or async)
146+
that takes a single argument of :class:`AutocompleteContext`.
147+
The callable must return an iterable of :class:`str` or :class:`OptionChoice`.
148+
Alternatively, :func:`discord.utils.basic_autocomplete` may be used in place of the callable.
148149
149150
.. note::
150151

0 commit comments

Comments
 (0)