selectCommand

fun selectCommand(command: Command)

Switches the message composer to the command input mode.

Sets MessageComposerState.activeCommand and clears the text input so the user can type the command arguments. The full /command args string is assembled in buildNewMessage.

When Config.activeCommandEnabled is true, any pre-command input value, picker-selected attachments, and mention selections are stashed so clearActiveCommand can restore them if the user dismisses the command. Re-selecting a command while one is already active does not overwrite an existing stash (in-command input is command-specific and not preserved across command switches).

When Config.activeCommandEnabled is true and the command is not available for the current composer action (edit mode or a moderation command during reply), emits a MessageComposerViewEvent.CommandUnavailable on events and returns without changing the active command. Legacy mode skips this check and sets the command unconditionally.

Parameters

command

The command that was selected.