Package org.javacord.api.interaction
Interface InteractionBase
-
- All Superinterfaces:
DiscordEntity
- All Known Subinterfaces:
ButtonInteraction,Interaction,MessageComponentInteraction,MessageComponentInteractionBase,SelectMenuInteraction,SlashCommandInteraction
public interface InteractionBase extends DiscordEntity
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InteractionFollowupMessageBuildercreateFollowupMessageBuilder()Create a message builder to send follow up messages for this interaction.InteractionImmediateResponseBuildercreateImmediateResponder()Create a response builder that can be used to immediately reply to this interaction with a message.longgetApplicationId()Gets the id of the application that this interaction is for.Optional<TextChannel>getChannel()Gets the channel that this interaction was sent from.Optional<Server>getServer()Gets the server that this interaction was sent from.StringgetToken()Gets the continuation token for responding to the interaction.InteractionTypegetType()Gets the type of the interaction.UsergetUser()Gets the invoking user.intgetVersion()Gets the version.CompletableFuture<InteractionOriginalResponseUpdater>respondLater()Sends an acknowledgement of the interaction to Discord and displays a loading state to the user, indicating that you'll respond with a delay.-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getApi, getCreationTimestamp, getCreationTimestamp, getId, getIdAsString
-
-
-
-
Method Detail
-
getApplicationId
long getApplicationId()
Gets the id of the application that this interaction is for.- Returns:
- The id of the application.
-
getType
InteractionType getType()
Gets the type of the interaction.- Returns:
- The type of the interaction.
-
createImmediateResponder
InteractionImmediateResponseBuilder createImmediateResponder()
Create a response builder that can be used to immediately reply to this interaction with a message. Please note that you have to callrespond()on the returned object within 3 seconds after receiving the interaction.- Returns:
- The new response builder.
-
respondLater
CompletableFuture<InteractionOriginalResponseUpdater> respondLater()
Sends an acknowledgement of the interaction to Discord and displays a loading state to the user, indicating that you'll respond with a delay. Please note that you can only actually update this loading state message within 15 minutes after receiving the interaction.- Returns:
- A CompletableFuture that completes as soon as the acknowledgement has been sent; it yields an updater that should be used to update the message later on.
-
createFollowupMessageBuilder
InteractionFollowupMessageBuilder createFollowupMessageBuilder()
Create a message builder to send follow up messages for this interaction. You can send, edit and delete follow up messages up to 15 minutes after you received the interaction.- Returns:
- The new message builder.
-
getServer
Optional<Server> getServer()
Gets the server that this interaction was sent from.- Returns:
- The server.
-
getChannel
Optional<TextChannel> getChannel()
Gets the channel that this interaction was sent from.- Returns:
- The channel.
-
getUser
User getUser()
Gets the invoking user.- Returns:
- The invoking user.
-
getToken
String getToken()
Gets the continuation token for responding to the interaction.- Returns:
- The token.
-
getVersion
int getVersion()
Gets the version.- Returns:
- The version.
-
-