GuildChannelConverter<T extends GuildChannel> class
A converter that converts input to one or more types of GuildChannels.
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 GuildChannels;
- textGuildChannelConverter, a converter for GuildTextChannels;
- voiceGuildChannelConverter, a converter for GuildVoiceChannels;
- categoryGuildChannelConverter, a converter for GuildCategorys;
- stageVoiceChannelConverter, a converter for GuildStageChannels.
- Implemented types
-
- Converter<
T>
- Converter<
Constructors
-
GuildChannelConverter(List<
ChannelType> ? channelTypes) -
Create a new GuildChannelConverter.
const
Properties
-
autocompleteCallback
→ (FutureOr<
Iterable< Function(AutocompleteContext)?)CommandOptionChoiceBuilder> ?> -
A function called to provide autocompletion
for arguments of this type.
no setteroverride
-
channelTypes
→ List<
ChannelType> ? -
The types of channels this converter allows users to select.
final
-
choices
→ Iterable<
CommandOptionChoiceBuilder> -
The choices for this type.
no setteroverride
-
convert
→ FutureOr<
T?> Function(StringView, ContextData) -
The function called to perform the conversion.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
-
output
→ RuntimeType<
T> -
The type that this converter parses.
no setteroverride
- processOptionCallback → void Function(CommandOptionBuilder)
-
A callback called with the CommandOptionBuilder created for an option using this converter.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- toButton → ButtonBuilder Function(T)
-
A function called to provide ButtonBuilders that can be used to represent an element
converted by this converter.
no setteroverride
- toSelectMenuOption → SelectMenuOptionBuilder Function(T)
-
A function called to provide SelectMenuOptionBuilders that can be used to represent an
element converted by this converter.
no setteroverride
- type → CommandOptionType
-
The Discord Slash Command Argument Type
of the type that this converter parses.
no setteroverride
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited