Class ChatInputAutoCompleteEvent
java.lang.Object
discord4j.core.event.domain.Event
discord4j.core.event.domain.interaction.InteractionCreateEvent
discord4j.core.event.domain.interaction.AutoCompleteInteractionEvent
discord4j.core.event.domain.interaction.ChatInputAutoCompleteEvent
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:
respondWithSuggestions(Iterable)
respond with up to 25 choices to suggest
This is not directly dispatched by Discord, but is a utility specialization of AutoCompleteInteractionEvent
.
-
Constructor Summary
ConstructorDescriptionChatInputAutoCompleteEvent
(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction) -
Method Summary
Modifier and TypeMethodDescriptionGets the ID of the invoked command.Gets the name of the invoked command.Gets the type of the invoked command.Gets the currently focused option for auto-complete.Gets the option corresponding to the provided name, if present.Gets the options of the invoked command.respondWithSuggestions
(Iterable<discord4j.discordjson.json.ApplicationCommandOptionChoiceData> choices) Requests to respond to the interaction with a list of suggested choices.Methods inherited from class discord4j.core.event.domain.interaction.InteractionCreateEvent
createInteractionResponse, createInteractionResponse, getInteraction
Methods inherited from class discord4j.core.event.domain.Event
getClient, getShardInfo
-
Constructor Details
-
ChatInputAutoCompleteEvent
public ChatInputAutoCompleteEvent(GatewayDiscordClient gateway, ShardInfo shardInfo, Interaction interaction)
-
-
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 theMono
.
-
getCommandId
Gets the ID of the invoked command.- Returns:
- The ID of the invoked command.
-
getCommandName
Gets the name of the invoked command.- Returns:
- The name of the invoked command.
-
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
Gets the currently focused option for auto-complete.- Returns:
- The currently focused option for auto-complete.
-