getChannel<T extends PartialTextChannel> method

T? getChannel<T extends PartialTextChannel>(
  1. String optionName
)

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

Example :

Channel? channel = interaction.getChannel('option_name');

Implementation

T? getChannel<T extends PartialTextChannel> (String optionName) {
  return guild?.channels.cache.get(params[optionName]);
}