getCmd abstract method

String? getCmd(
  1. Mapping content, [
  2. String? defaultValue
])

Retrieves the command name from a structured command content Map.

Looks up the command name key (e.g., "command") in the content Map and returns its value. If the key is not found or the value is null, returns the defaultValue (if provided).

Parameters:

  • content : The structured command payload (Map) to extract the command name from
  • defaultValue : Optional fallback value if the command name is not found

Returns: Extracted command name (String), or defaultValue, or null if neither exists

Implementation

String? getCmd(Mapping content, [String? defaultValue]);