Package net.dv8tion.jda.api.interactions
Enum Class InteractionContextType
- All Implemented Interfaces:
Serializable,Comparable<InteractionContextType>,Constable
Represents where commands can be used.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUsable in the bot's DM.Usable in guilds.Usable in private channels other than the bot DMs, includes friend DMs and Group DMs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Set<InteractionContextType> Contains all interaction types. -
Method Summary
Modifier and TypeMethodDescriptionstatic InteractionContextTypeGets the interaction context corresponding to the key, returnsUNKNOWNif no entry matches.getType()The raw value of this interaction context.static InteractionContextTypeReturns the enum constant of this class with the specified name.static InteractionContextType[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
UNKNOWN
-
GUILD
Usable in guilds.Note: Using this command in guilds the bot isn't in requires the
USER_INSTALLinstallation context. (SeeCommandData.setContexts(InteractionContextType...)) -
BOT_DM
Usable in the bot's DM. -
PRIVATE_CHANNEL
Usable in private channels other than the bot DMs, includes friend DMs and Group DMs.Requirements
This requires theUSER_INSTALLinstallation context.
-
-
Field Details
-
ALL
Contains all interaction types.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getType
The raw value of this interaction context.- Returns:
- The raw value
-
fromKey
Gets the interaction context corresponding to the key, returnsUNKNOWNif no entry matches.- Parameters:
key- The key to match against- Returns:
- The interaction context corresponding to the key
-