Class AutoCompleteEvent
java.lang.Object
io.github.kaktushose.jdac.dispatching.events.Event<CommandAutoCompleteInteractionEvent>
io.github.kaktushose.jdac.dispatching.events.interactions.AutoCompleteEvent
- All Implemented Interfaces:
ISnowflake, Interaction
This class is a subclass of
Event.
It provides additional features for replying to a CommandAutoCompleteInteractionEvent.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()The name of the input field, usually an option name inCommandAutoCompleteInteraction.The expected option type for this query.getValue()The query value that the user is currently typing.voidreplyChoice(String name, double value) Reply with up to 25 choices which can be picked from by the user.voidreplyChoice(String name, long value) Reply with up to 25 choices which can be picked from by the user.voidreplyChoice(String name, String value) Reply with up to 25 choices which can be picked from by the user.voidreplyChoiceDoubles(double... choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoiceDoubles(Collection<Double> choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoiceLongs(long... choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoiceLongs(Collection<Long> choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoices(Collection<Command.Choice> choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoices(Command.Choice... choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoiceStrings(String... choices) Reply with up to 25 choices which can be picked from by the user.voidreplyChoiceStrings(Collection<String> choices) Reply with up to 25 choices which can be picked from by the user.Methods inherited from class Event
closeRuntime, getChannel, getChannelIdLong, getContext, getEntitlements, getGuild, getIdLong, getIntegrationOwners, getJDA, getMember, getToken, getTypeRaw, getUser, getUserLocale, interactionInstance, introspection, isAcknowledged, jdaEvent, kv, messageResolver, resolve, resolve, runtimeIdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Interaction
getChannelId, getChannelType, getGuildChannel, getGuildLocale, getMessageChannel, getType, isFromAttachedGuild, isFromGuildMethods inherited from interface ISnowflake
getId, getTimeCreated
-
Constructor Details
-
AutoCompleteEvent
public AutoCompleteEvent()
-
-
Method Details
-
replyChoices
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
choices- The choice suggestions to present to the user, 0-25 choices- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If any of the choice names are empty or longer than 100
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If the string value of any of the choices is empty or longer than 100
- If
-
replyChoices
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
choices- The choice suggestions to present to the user, 0-25 choices- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If any of the choice names are empty or longer than 100
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If the string value of any of the choices is empty or longer than 100
- If
-
replyChoice
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
name- The choice name to show to the user, 1-100 charactersvalue- The choice value, 1-100 characters- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the choice name is empty or longer than 100
- If the option type is not
OptionType.STRING - If the string value of any of the choices is empty or longer than 100
- If
-
replyChoice
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
name- The choice name to show to the user, 1-100 charactersvalue- The choice value, must be between -9.007199254740991E15 and 9.007199254740991E15- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the choice name is empty or longer than 100
- If the option type is incompatible with the choice type
- If the value of is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
replyChoice
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.- Parameters:
name- The choice name to show to the user, 1-100 charactersvalue- The choice value, must be between -9.007199254740991E15 and 9.007199254740991E15- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the choice name is empty or longer than 100
- If the option type is incompatible with the choice type
- If the value of is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
replyChoiceStrings
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The provided strings will be used as value and name for the
Choices.- Parameters:
choices- The choice suggestions to present to the user, each limited to 100 characters- Throws:
IllegalArgumentException-
-
replyChoiceStrings
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The provided strings will be used as value and name for the
Choices.- Parameters:
choices- The choice suggestions to present to the user, each limited to 100 characters- Throws:
IllegalArgumentException-
-
replyChoiceLongs
public void replyChoiceLongs(long... choices) Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided longs will be used as value and name for the
Choices.- Parameters:
choices- The choice suggestions to present to the user- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
replyChoiceLongs
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided longs will be used as value and name for the
Choices.- Parameters:
choices- The choice suggestions to present to the user- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
replyChoiceDoubles
public void replyChoiceDoubles(double... choices) Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided doubles will be used as value and name for the
Choices.- Parameters:
choices- The choice suggestions to present to the user- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
replyChoiceDoubles
Reply with up to 25 choices which can be picked from by the user.
The user may continue writing inputs instead of using one of your choices.The string values of the provided doubles will be used as value and name for the
Choices.- Parameters:
choices- The choice suggestions to present to the user- Throws:
IllegalArgumentException-- If
nullis provided - If more than 25 choices are added
- If the option type is incompatible with the choice type
- If the numeric value of any of the choices is not between -9.007199254740991E15 and 9.007199254740991E15
- If
-
getName
The name of the input field, usually an option name inCommandAutoCompleteInteraction.- Returns:
- The option name
-
getValue
The query value that the user is currently typing.
This is not validated and may not be a valid value for an actual command. For instance, a user may input invalid numbers for
OptionType.NUMBER.- Returns:
- The current auto-completable query value
-
getOptionType
The expected option type for this query.- Returns:
- The option type expected from this auto-complete response
-