getChoice<T> method

T? getChoice<T>(
  1. String optionName
)

Returns an T if the command has the designed option

Example :

String? str = interaction.getChoice<String>('option_name');
int? value = interaction.getChoice<int>('option_name');

Implementation

T? getChoice<T> (String optionName) {
  return params[optionName];
}