Search in sources :

Example 1 with TriggerRestAction

use of net.dv8tion.jda.internal.requests.restaction.TriggerRestAction in project JDA by DV8FromTheWorld.

the class InteractionHookImpl method retrieveOriginal.

@Nonnull
@Override
public RestAction<Message> retrieveOriginal() {
    JDAImpl jda = (JDAImpl) getJDA();
    Route.CompiledRoute route = Route.Interactions.GET_ORIGINAL.compile(jda.getSelfUser().getApplicationId(), interaction.getToken());
    return onReady(new TriggerRestAction<>(jda, route, (response, request) -> jda.getEntityBuilder().createMessageWithChannel(response.getObject(), getInteraction().getMessageChannel(), false)));
}
Also used : Message(net.dv8tion.jda.api.entities.Message) Checks(net.dv8tion.jda.internal.utils.Checks) JDA(net.dv8tion.jda.api.JDA) ReentrantLock(java.util.concurrent.locks.ReentrantLock) TimeoutException(java.util.concurrent.TimeoutException) MiscUtil(net.dv8tion.jda.api.utils.MiscUtil) Route(net.dv8tion.jda.internal.requests.Route) Function(java.util.function.Function) TimeUnit(java.util.concurrent.TimeUnit) List(java.util.List) Future(java.util.concurrent.Future) WebhookMessageUpdateActionImpl(net.dv8tion.jda.internal.requests.restaction.WebhookMessageUpdateActionImpl) AbstractWebhookClient(net.dv8tion.jda.internal.entities.AbstractWebhookClient) JDAImpl(net.dv8tion.jda.internal.JDAImpl) InteractionHook(net.dv8tion.jda.api.interactions.InteractionHook) DataObject(net.dv8tion.jda.api.utils.data.DataObject) JDALogger(net.dv8tion.jda.internal.utils.JDALogger) LinkedList(java.util.LinkedList) Nonnull(javax.annotation.Nonnull) RestAction(net.dv8tion.jda.api.requests.RestAction) TriggerRestAction(net.dv8tion.jda.internal.requests.restaction.TriggerRestAction) WebhookMessageActionImpl(net.dv8tion.jda.internal.requests.restaction.WebhookMessageActionImpl) JDAImpl(net.dv8tion.jda.internal.JDAImpl) Route(net.dv8tion.jda.internal.requests.Route) Nonnull(javax.annotation.Nonnull)

Aggregations

LinkedList (java.util.LinkedList)1 List (java.util.List)1 Future (java.util.concurrent.Future)1 TimeUnit (java.util.concurrent.TimeUnit)1 TimeoutException (java.util.concurrent.TimeoutException)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1 Function (java.util.function.Function)1 Nonnull (javax.annotation.Nonnull)1 JDA (net.dv8tion.jda.api.JDA)1 Message (net.dv8tion.jda.api.entities.Message)1 InteractionHook (net.dv8tion.jda.api.interactions.InteractionHook)1 RestAction (net.dv8tion.jda.api.requests.RestAction)1 MiscUtil (net.dv8tion.jda.api.utils.MiscUtil)1 DataObject (net.dv8tion.jda.api.utils.data.DataObject)1 JDAImpl (net.dv8tion.jda.internal.JDAImpl)1 AbstractWebhookClient (net.dv8tion.jda.internal.entities.AbstractWebhookClient)1 Route (net.dv8tion.jda.internal.requests.Route)1 TriggerRestAction (net.dv8tion.jda.internal.requests.restaction.TriggerRestAction)1 WebhookMessageActionImpl (net.dv8tion.jda.internal.requests.restaction.WebhookMessageActionImpl)1 WebhookMessageUpdateActionImpl (net.dv8tion.jda.internal.requests.restaction.WebhookMessageUpdateActionImpl)1