from_list
Function
Autocomplete from a list of strings.
from discord_interactions import from_listSignature
def from_list( items: List[str], *, value_transform: Callable[[str], Any] | None = None,) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
items | List[str] | required | |
value_transform | Callable[[str], Any] | None | None |
Returns
Callable[..., Awaitable[List[Tuple[str, Any]]]]
Details
Example:
@slash.command()@autocomplete("color", from_list(["red", "green", "blue"]))async def set_color(ctx, color: str): ...