Package net.dv8tion.jda.api.interactions
Enum InteractionContextType
- All Implemented Interfaces:
Serializable
,Comparable<InteractionContextType>
Represents where commands can be used.
- See Also:
-
Enum Constant Summary
Enum 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
Modifier and TypeFieldDescriptionstatic final Set
<InteractionContextType> Contains all interaction types. -
Method Summary
Modifier and TypeMethodDescriptionstatic InteractionContextType
Gets the interaction context corresponding to the key, returnsUNKNOWN
if no entry matches.getType()
The raw value of this interaction context.static InteractionContextType
Returns the enum constant of this type with the specified name.static InteractionContextType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
-
GUILD
Usable in guilds.Note: Using this command in guilds the bot isn't in requires the
USER_INSTALL
installation 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_INSTALL
installation context.
-
-
Field Details
-
ALL
Contains all interaction types.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type 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, returnsUNKNOWN
if no entry matches.- Parameters:
key
- The key to match against- Returns:
- The interaction context corresponding to the key
-