Package org.javacord.api.interaction
Interface Interaction
-
- All Superinterfaces:
DiscordEntity,InteractionBase,SafeSpecializable<InteractionBase>,Specializable<InteractionBase>
public interface Interaction extends InteractionBase, SafeSpecializable<InteractionBase>
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Optional<MessageComponentInteraction>asMessageComponentInteraction()Get this interaction as message component interaction if the type matches.default Optional<MessageComponentInteraction>asMessageComponentInteractionWithCustomId(String customId)Get this interaction as message component interaction if the type and the given custom id match.default Optional<SlashCommandInteraction>asSlashCommandInteraction()Get this interaction as slash command interaction if the type matches.default Optional<SlashCommandInteraction>asSlashCommandInteractionWithCommandId(long commandId)Get this interaction as slash command interaction if the type and the command id match.-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getCreationTimestamp, getId, getIdAsString
-
Methods inherited from interface org.javacord.api.interaction.InteractionBase
createFollowupMessageBuilder, createImmediateResponder, getApplicationId, getChannel, getServer, getToken, getType, getUser, getVersion, respondLater
-
Methods inherited from interface org.javacord.api.util.SafeSpecializable
as
-
-
-
-
Method Detail
-
asSlashCommandInteraction
default Optional<SlashCommandInteraction> asSlashCommandInteraction()
Get this interaction as slash command interaction if the type matches.- Returns:
- the interaction as slash command interaction if the type matches; an empty optional otherwise
-
asSlashCommandInteractionWithCommandId
default Optional<SlashCommandInteraction> asSlashCommandInteractionWithCommandId(long commandId)
Get this interaction as slash command interaction if the type and the command id match.- Parameters:
commandId- The command id to match.- Returns:
- the interaction as slash command interaction if the properties match; an empty optional otherwise
-
asMessageComponentInteraction
default Optional<MessageComponentInteraction> asMessageComponentInteraction()
Get this interaction as message component interaction if the type matches.- Returns:
- the interaction as message component interaction if the type matches; an empty optional otherwise
-
asMessageComponentInteractionWithCustomId
default Optional<MessageComponentInteraction> asMessageComponentInteractionWithCustomId(String customId)
Get this interaction as message component interaction if the type and the given custom id match.- Parameters:
customId- The custom id to match.- Returns:
- the interaction as message component interaction if the properties match; an empty optional otherwise
-
-