GuildChannelConverter<T extends GuildChannel> class
A converter that converts input to one or more types of GuildChannel
s.
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
GuildChannel
s; - textGuildChannelConverter, a converter for
GuildTextChannel
s; - voiceGuildChannelConverter, a converter for
GuildVoiceChannel
s; - categoryGuildChannelConverter, a converter for
GuildCategory
s; - stageVoiceChannelConverter, a converter for
GuildStageChannel
s.
- 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
ButtonBuilder
s that can be used to represent an element converted by this converter.no setteroverride - toSelectMenuOption → SelectMenuOptionBuilder Function(T)
-
A function called to provide
SelectMenuOptionBuilder
s 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