getString method

String? getString(
  1. String optionName
)

Returns an String if the command has the designed option

Example :

String? str = interaction.getString('option_name');

Implementation

String? getString (String optionName) {
  return data[optionName]?['value'];
}