InteractionChatContext class
A context in which a ChatCommand was invoked from an interaction.
You might also be interested in:
- MessageChatContext, a context in which a ChatCommand was executed from a text message;
- ChatContext, the base class for all context representing the execution of a ChatCommand.
- Implemented types
Constructors
-
InteractionChatContext({required Map<
String, dynamic> rawArguments, required ApplicationCommandInteraction interaction, required ChatCommand command, required User user, required Member? member, required Guild? guild, required TextChannel channel, required CommandsPlugin commands, required NyxxGateway client}) - Create a new InteractionChatContext.
Properties
- arguments ↔ List
-
The arguments parsed from the user input.
latefinalinherited
- 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 that was executed or is being processed.
finalinherited
- commands → CommandsPlugin
-
The instance of CommandsPlugin which created this context.
finalinherited
- delegate → InteractiveContext?
-
The delegate of this context.
no setterinherited
- 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 → ApplicationCommandInteraction
-
The interaction that triggered this context's creation.
final
- latestContext → InteractiveContext
-
The youngest context that handles all interactions.
no setterinherited
- member → Member?
-
The member that triggered this context's created, or
null
if created outside of a guild.finalinherited - parent → InteractiveContext?
-
The parent of this context.
no setterinherited
-
rawArguments
→ Map<
String, dynamic> -
The unparsed arguments from the interaction.
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
-
acknowledge(
{ResponseLevel? level}) → Future< void> -
Acknowledge the underlying interaction without yet sending a response.
inherited
-
awaitButtonPress(
ComponentId componentId) → Future< ButtonComponentContext> -
Wait for a user to press a button and return a context representing that button press.
inherited
-
awaitModal(
String customId, {Duration? timeout}) → Future< ModalContext> -
Wait for a user to submit a modal and return a context representing that submission.
inherited
-
awaitMultiSelection<
T> (ComponentId componentId, {Converter< T> ? converterOverride}) → Future<SelectMenuContext< List< >T> > -
Wait for a user to select options from a multi-select menu and return a context
representing that selection.
inherited
-
awaitSelection<
T> (ComponentId componentId, {Converter< T> ? converterOverride}) → Future<SelectMenuContext< T> > -
Wait for a user to select a single option from a multi-select menu and return a context
representing that selection.
inherited
-
getButtonPress(
Message message) → Future< ButtonComponentContext> -
Wait for a user to press on any button on a given message and return a context representing
the button press.
inherited
-
getButtonSelection<
T> (List< T> values, MessageBuilder builder, {Map<T, ButtonStyle> ? styles, bool authorOnly = true, ResponseLevel? level, Duration? timeout, FutureOr<ButtonBuilder> toButton(T)?, Converter<T> ? converterOverride}) → Future<T> -
Get a selection from a user, presenting the options as an array of buttons.
inherited
-
getConfirmation(
MessageBuilder builder, {Map< bool, String> values = const {true : 'Yes', false : 'No'}, Map<bool, ButtonStyle> styles = const {true : ButtonStyle.success, false : ButtonStyle.danger}, bool authorOnly = true, ResponseLevel? level, Duration? timeout}) → Future<bool> -
Present the user with two options and return whether the positive one was clicked.
inherited
-
getModal(
{required String title, required List< TextInputBuilder> components, Duration? timeout}) → Future<ModalContext> -
Present the user with a modal, wait for them to submit it, and return a context representing
that submission.
inherited
-
getMultiSelection<
T> (List< T> choices, MessageBuilder builder, {ResponseLevel? level, Duration? timeout, bool authorOnly = true, FutureOr<SelectMenuOptionBuilder> toSelectMenuOption(T)?, Converter<T> ? converterOverride}) → Future<List< T> > -
Present the user with a drop-down menu of choices and return the selected choices.
inherited
-
getSelection<
T> (List< T> choices, MessageBuilder builder, {ResponseLevel? level, Duration? timeout, bool authorOnly = true, FutureOr<SelectMenuOptionBuilder> toSelectMenuOption(T)?, Converter<T> ? converterOverride}) → Future<T> -
Present the user with a drop-down menu of choices and return the selected choice.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
respond(
MessageBuilder builder, {ResponseLevel? level}) → Future< Message> -
Send a response to the command.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited