discord-interactions.py

AutocompleteRegistry

Class

Internal registry of autocomplete functions.

from discord_interactions.slash import AutocompleteRegistry

Constructor

AutocompleteRegistry()

Methods

register

def register(    command_name: str,    option_name: str,    handler: Callable[..., Awaitable[List[Tuple[str, Any]]]],) -> None

Register an autocomplete handler for a specific command option.

register_options

def register_options(command_path: str, command: Any) -> None

register_global

def register_global(    option_name: str,    handler: Callable[..., Awaitable[List[Tuple[str, Any]]]],) -> None

Register a global autocomplete handler that applies to all commands with an option of this name.

get_handler

def get_handler(    command_name: str,    option_name: str,) -> Callable[..., Awaitable[List[Tuple[str, Any]]]] | None

Get the handler for a command option.

handle

async def handle(interaction: discord.Interaction) -> None

Type a name: create_button, ModalBuilder, cooldown.