Package org.javacord.core.interaction
Class InteractionImpl
- java.lang.Object
-
- org.javacord.core.interaction.InteractionImpl
-
- All Implemented Interfaces:
DiscordEntity
,Interaction
,InteractionBase
,Specializable<InteractionBase>
- Direct Known Subclasses:
ApplicationCommandInteractionImpl
,MessageComponentInteractionImpl
,ModalInteractionImpl
public abstract class InteractionImpl extends java.lang.Object implements Interaction
-
-
Constructor Summary
Constructors Constructor Description InteractionImpl(DiscordApiImpl api, TextChannel channel, com.fasterxml.jackson.databind.JsonNode jsonData)
Class constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description InteractionFollowupMessageBuilder
createFollowupMessageBuilder()
InteractionImmediateResponseBuilder
createImmediateResponder()
DiscordApi
getApi()
long
getApplicationId()
java.util.Optional<java.util.EnumSet<PermissionType>>
getBotPermissions()
java.util.Optional<TextChannel>
getChannel()
long
getId()
DiscordLocale
getLocale()
java.util.Optional<Server>
getServer()
java.util.Optional<DiscordLocale>
getServerLocale()
java.lang.String
getToken()
abstract InteractionType
getType()
User
getUser()
int
getVersion()
java.util.concurrent.CompletableFuture<InteractionOriginalResponseUpdater>
respondLater()
java.util.concurrent.CompletableFuture<InteractionOriginalResponseUpdater>
respondLater(boolean ephemeral)
java.util.concurrent.CompletableFuture<java.lang.Void>
respondWithModal(java.lang.String customId, java.lang.String title, java.util.List<HighLevelComponent> components)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.javacord.api.entity.DiscordEntity
getCreationTimestamp, getIdAsString
-
Methods inherited from interface org.javacord.api.interaction.Interaction
asAutocompleteInteraction, asAutocompleteInteraction, asMessageComponentInteraction, asMessageComponentInteractionWithCustomId, asMessageContextMenuInteraction, asMessageContextMenuInteractionWithCommandId, asModalInteraction, asModalInteractionWithCustomId, asSlashCommandInteraction, asSlashCommandInteractionWithCommandId, asUserContextMenuInteraction, asUserContextMenuInteractionWithCommandId
-
Methods inherited from interface org.javacord.api.interaction.InteractionBase
respondWithModal
-
Methods inherited from interface org.javacord.api.util.Specializable
as
-
-
-
-
Constructor Detail
-
InteractionImpl
public InteractionImpl(DiscordApiImpl api, TextChannel channel, com.fasterxml.jackson.databind.JsonNode jsonData)
Class constructor.- Parameters:
api
- The api instance.channel
- The channel in which the interaction happened. Can benull
.jsonData
- The json data of the interaction.
-
-
Method Detail
-
getApi
public DiscordApi getApi()
- Specified by:
getApi
in interfaceDiscordEntity
-
getId
public long getId()
- Specified by:
getId
in interfaceDiscordEntity
-
getApplicationId
public long getApplicationId()
- Specified by:
getApplicationId
in interfaceInteractionBase
-
getType
public abstract InteractionType getType()
- Specified by:
getType
in interfaceInteractionBase
-
createImmediateResponder
public InteractionImmediateResponseBuilder createImmediateResponder()
- Specified by:
createImmediateResponder
in interfaceInteractionBase
-
respondLater
public java.util.concurrent.CompletableFuture<InteractionOriginalResponseUpdater> respondLater()
- Specified by:
respondLater
in interfaceInteractionBase
-
respondLater
public java.util.concurrent.CompletableFuture<InteractionOriginalResponseUpdater> respondLater(boolean ephemeral)
- Specified by:
respondLater
in interfaceInteractionBase
-
respondWithModal
public java.util.concurrent.CompletableFuture<java.lang.Void> respondWithModal(java.lang.String customId, java.lang.String title, java.util.List<HighLevelComponent> components)
- Specified by:
respondWithModal
in interfaceInteractionBase
-
createFollowupMessageBuilder
public InteractionFollowupMessageBuilder createFollowupMessageBuilder()
- Specified by:
createFollowupMessageBuilder
in interfaceInteractionBase
-
getServer
public java.util.Optional<Server> getServer()
- Specified by:
getServer
in interfaceInteractionBase
-
getChannel
public java.util.Optional<TextChannel> getChannel()
- Specified by:
getChannel
in interfaceInteractionBase
-
getUser
public User getUser()
- Specified by:
getUser
in interfaceInteractionBase
-
getToken
public java.lang.String getToken()
- Specified by:
getToken
in interfaceInteractionBase
-
getVersion
public int getVersion()
- Specified by:
getVersion
in interfaceInteractionBase
-
getLocale
public DiscordLocale getLocale()
- Specified by:
getLocale
in interfaceInteractionBase
-
getServerLocale
public java.util.Optional<DiscordLocale> getServerLocale()
- Specified by:
getServerLocale
in interfaceInteractionBase
-
getBotPermissions
public java.util.Optional<java.util.EnumSet<PermissionType>> getBotPermissions()
- Specified by:
getBotPermissions
in interfaceInteractionBase
-
-