Skip to content

Commit

Permalink
Add missing getJDA() on Interaction (#1782)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikammerlaan authored and DV8FromTheWorld committed Sep 10, 2021
1 parent 28bdbe6 commit 5f216d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/net/dv8tion/jda/api/interactions/Interaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package net.dv8tion.jda.api.interactions;

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.interactions.components.ComponentInteraction;
import net.dv8tion.jda.api.requests.restaction.interactions.ReplyAction;
Expand Down Expand Up @@ -483,4 +484,13 @@ default PrivateChannel getPrivateChannel()
return (PrivateChannel) channel;
throw new IllegalStateException("Cannot convert channel of type " + getChannelType() + " to PrivateChannel");
}

/**
* Returns the {@link net.dv8tion.jda.api.JDA JDA} instance of this interaction
*
* @return the corresponding JDA instance
*/
@Nonnull
JDA getJDA();

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package net.dv8tion.jda.internal.interactions;

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.interactions.Interaction;
import net.dv8tion.jda.api.interactions.InteractionHook;
Expand Down Expand Up @@ -152,4 +153,11 @@ public ReplyActionImpl deferReply()
{
return new ReplyActionImpl(this.hook);
}

@Nonnull
@Override
public JDA getJDA()
{
return api;
}
}

0 comments on commit 5f216d4

Please sign in to comment.