handleInput method

Future<void> handleInput(
  1. String text, {
  2. List<InputAttachment> attachments = const [],
})

Handle user input — dispatches slash commands or sends as a message.

Implementation

Future<void> handleInput(
  String text, {
  List<InputAttachment> attachments = const [],
}) async {
  if (text.trim().isEmpty && attachments.isEmpty) return;

  final trimmed = text.trim();
  if (trimmed.startsWith('/')) {
    await _dispatchCommand(trimmed);
  } else {
    await sendMessage(text, attachments: attachments);
  }
}