GuildChannelConverter<T extends IGuildChannel> class
Null safety
A converter that converts input to one or more types of IGuildChannels.
This converter will only allow users to select channels of one of the types in channelTypes,
and then will further only accept channels of type T
.
Note: this converter does not ensure that all values will conform to channelTypes.
channelTypes offers purely client-side validation and input from text commands will not be
validated beyond being assignable to T
.
You might also be interested in:
- guildChannelConverter, a converter for all IGuildChannels;
- textGuildChannelConverter, a converter for ITextGuildChannels;
- voiceGuildChannelConverter, a converter for IVoiceGuildChannels;
- categoryGuildChannelConverter, a converter for ICategoryGuildChannels;
- stageVoiceChannelConverter, a converter for IStageVoiceGuildChannels.
- Implemented types
-
- Converter<
T>
- Converter<
Constructors
-
GuildChannelConverter(List<
ChannelType> ? channelTypes) -
Create a new GuildChannelConverter.
const
Properties
-
autocompleteCallback
→ (FutureOr<
Iterable< Function(AutocompleteContext)?)ArgChoiceBuilder> ?> -
A function called to provide autocompletion
for arguments of this type.
read-onlyoverride
-
channelTypes
→ List<
ChannelType> ? -
The types of channels this converter allows users to select.
final
-
choices
→ Iterable<
ArgChoiceBuilder> -
The choices for this type.
read-onlyoverride
-
convert
→ FutureOr<
T?> Function(StringView, IChatContext) -
The function called to perform the conversion.
read-onlyoverride
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- output → Type
-
The type that this converter parses.
read-onlyoverride
- processOptionCallback → void Function(CommandOptionBuilder)
-
A callback called with the CommandOptionBuilder created for an option using this converter.
read-onlyoverride
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- type → CommandOptionType
-
The Discord Slash Command Argument Type
of the type that this converter parses.
read-onlyoverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited