Skip to content

CommandsOption

type CommandsOption = {
enabled: boolean;
onSearch?: (query: string) => Promise<Command[]>;
onSelect?: (command: Command) => Promise<void | CommandSelection>;
};
enabled: boolean;

Enables the ”/” command menu, including applicable built-in composer actions.


optional onSearch: (query: string) => Promise<Command[]>;

Returns integration-defined commands matching the input query.

Parameter Type

query

string

Promise<Command[]>


optional onSelect: (command: Command) => Promise<
| void
| CommandSelection>;

Runs a command. Return an entity to insert it, another menu to continue command selection, or nothing when the command only performs an effect.

Parameter Type

command

Command

Promise< | void | CommandSelection>