getString method

String? getString(
  1. String optionName
)

Returns an String or null if the command has the designed option

Example :

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

Implementation

String? getString (String optionName) {
  return params[optionName].toString();
}