categoryGuildChannelConverter top-level constant Null safety

Converter<ICategoryGuildChannel> const categoryGuildChannelConverter

Converter to convert input to ICategoryGuildChannels.

This uses multiple strategies to look up channels, in the order below:

  • ID lookup (parse input as snowflake)
  • Full case insensitive channel name match
  • Partial case insensitive channel name match (channel name starts with input)

Note that for all of these strategies, if multiple channels match any condition then no results will be given based off of that condition.

Implementation

const Converter<ICategoryGuildChannel> categoryGuildChannelConverter = FallbackConverter(
  [
    CombineConverter<Snowflake, ICategoryGuildChannel>(
        snowflakeConverter, snowflakeToGuildChannel<ICategoryGuildChannel>),
    Converter<ICategoryGuildChannel>(convertGuildChannel<ICategoryGuildChannel>),
  ],
  type: CommandOptionType.channel,
);