Class ChatInputAutoCompleteEvent


@Experimental public class ChatInputAutoCompleteEvent extends AutoCompleteInteractionEvent
Dispatched when a user is typing an application command option that has auto-complete enabled.

You are required to respond to this interaction within a three-second window by using the following:

This is not directly dispatched by Discord, but is a utility specialization of AutoCompleteInteractionEvent.

  • Constructor Details

  • Method Details

    • respondWithSuggestions

      public Mono<Void> respondWithSuggestions(Iterable<discord4j.discordjson.json.ApplicationCommandOptionChoiceData> choices)
      Requests to respond to the interaction with a list of suggested choices.
      Parameters:
      choices - The list of suggested choices.
      Returns:
      A Mono where, upon successful completion, emits nothing; indicating the interaction response has been sent. If an error is received, it is emitted through the Mono.
    • getCommandId

      public Snowflake getCommandId()
      Gets the ID of the invoked command.
      Returns:
      The ID of the invoked command.
    • getCommandName

      public String getCommandName()
      Gets the name of the invoked command.
      Returns:
      The name of the invoked command.
    • getCommandType

      public ApplicationCommand.Type getCommandType()
      Gets the type of the invoked command.
      Returns:
      The type of the invoked command.
    • getOptions

      Gets the options of the invoked command.
      Returns:
      The options of the invoked command.
    • getOption

      Gets the option corresponding to the provided name, if present.
      Parameters:
      name - The name of the option.
      Returns:
      The option corresponding to the provided name, if present.
    • getFocusedOption

      public ApplicationCommandInteractionOption getFocusedOption()
      Gets the currently focused option for auto-complete.
      Returns:
      The currently focused option for auto-complete.