discord-interactions.py

chain

Function

Combines several autocompletes, without duplicates.

from discord_interactions.slash import chain

Signature

def chain(    *handlers: Callable[..., Awaitable[List[Tuple[str, Any]]]],) -> Callable[..., Awaitable[List[Tuple[str, Any]]]]

Parameters

NameTypeDefaultDescription
*handlersCallable[..., Awaitable[List[Tuple[str, Any]]]]

Returns

Callable[..., Awaitable[List[Tuple[str, Any]]]]

Details

Example:

@slash.command()@autocomplete("item", chain(    from_list(["common1", "common2"]),    fetch_recent_items,))async def select_item(ctx, item: str): ...

Type a name: create_button, ModalBuilder, cooldown.