Skip to content

Commit c2b4011

Browse files
committed
📝 Move docstring to getter
1 parent 9121251 commit c2b4011

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

discord/commands/options.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,30 +389,31 @@ def __repr__(self):
389389

390390
@property
391391
def autocomplete(self):
392-
return self._autocomplete
393-
394-
@autocomplete.setter
395-
def autocomplete(self, value) -> None:
396392
"""
397393
The autocomplete handler for the option. Accepts a callable (sync or async)
398394
that takes a single required argument of :class:`AutocompleteContext`.
399395
The callable must return an iterable of :class:`str` or :class:`OptionChoice`.
400396
Alternatively, :func:`discord.utils.basic_autocomplete` may be used in place of the callable.
401397
402-
Parameters
403-
----------
404-
value: Union[
398+
Returns
399+
-------
400+
Union[
405401
Callable[[Self, AutocompleteContext, Any], AutocompleteReturnType],
406402
Callable[[AutocompleteContext, Any], AutocompleteReturnType],
407403
Callable[[Self, AutocompleteContext, Any], Awaitable[AutocompleteReturnType]],
408404
Callable[[AutocompleteContext, Any], Awaitable[AutocompleteReturnType]],
405+
None
409406
]
410407
411408
.. versionchanged:: 2.7
412409
413410
.. note::
414411
Does not validate the input value against the autocomplete results.
415412
"""
413+
return self._autocomplete
414+
415+
@autocomplete.setter
416+
def autocomplete(self, value) -> None:
416417
self._autocomplete = value
417418
# this is done here so it does not have to be computed every time the autocomplete is invoked
418419
if self._autocomplete is not None:

0 commit comments

Comments
 (0)