getRole method

Role? getRole(
  1. String optionName
)

Returns an instance of Role or null if the command has the designed option

Example :

Role? role = interaction.getRole('option_name');

Implementation

Role? getRole(String optionName) {
  return guild?.roles.cache.get(params[optionName]);
}