getMember method

GuildMember? getMember(
  1. String optionName
)

Returns an instance of GuildMember if the command has the designed option

Example :

GuildMember? member = interaction.getMember('option_name');

Implementation

GuildMember? getMember (String optionName) {
  return guild?.members.cache.get(params[optionName]);
}