AutocompleteContext class
Represents a context in which an autocomplete event was triggered.
- Implemented types
Constructors
- AutocompleteContext({required ChatCommand command, required ApplicationCommandAutocompleteInteraction interaction, required InteractionOption option, required String currentValue, required User user, required Member? member, required Guild? guild, required TextChannel channel, required CommandsPlugin commands, required NyxxGateway client})
- Create a new AutocompleteContext.
Properties
-
arguments
↔ Map<
String, String?> -
A map containing the arguments of command and their value, if the user has inputted a value
for them.
latefinal
- channel → TextChannel
-
The channel in which the context was created.
finalinherited
- client → NyxxGateway
-
The client that emitted the event triggering this context's creation.
finalinherited
- command → ChatCommand
-
The command for which arguments are being auto-completed.
final
- commands → CommandsPlugin
-
The instance of CommandsPlugin which created this context.
finalinherited
- currentValue → String
-
The value the user has put in option so far.
final
-
existingArguments
→ Map<
String, String> -
A map containing the arguments and the values that the user has inputted so far.
latefinal
- guild → Guild?
-
The guild in which the context was created, or
null
if created outside of a guild.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- interaction → ApplicationCommandAutocompleteInteraction
-
The interaction that triggered this context's creation.
final
- member → Member?
-
The member that triggered this context's created, or
null
if created outside of a guild.finalinherited - option → InteractionOption
-
The option that the user is currently filling in.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- user → User
-
The user that triggered this context's creation.
finalinherited
Methods
-
hasArgument(
String name) → bool -
Whether the user has inputted a value for an argument with the name
name
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse<
T> () → Future< T?> -
Attempts to parse the current value of this context as a value of type
T
. -
parseAllWithType<
T> () → Stream< T?> -
Finds all the arguments with a type of
T
in the command callback and parses them. -
parseNamed<
T> (String name) → Future< T?> -
Attempts to parse the value of the option
name
to a value of typeT
. -
parseWithType<
T> () → Future< T?> -
Parses the first option in the command callback with type
T
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited