Class ReplyableEvent<T extends GenericInteractionCreateEvent>
- All Implemented Interfaces:
Reply
,ISnowflake
,Interaction
- Direct Known Subclasses:
ModalEvent
,ModalReplyableEvent
Subtype of Event
that supports replying to the GenericInteractionCreateEvent
with text messages.
You can either reply directly by using one of the reply
methods, like reply(String)
, or you can call
with()
to use a ConfigurableReply
to append components or override reply settings from the
ReplyConfig
.
Example:
public void onInteraction(ReplayableEvent<?> event) {
event.reply("Hello World");
}
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
ReplyableEvent
(T event, InteractionRegistry interactionRegistry, com.github.kaktushose.jda.commands.dispatching.Runtime runtime, InteractionDefinition definition, InteractionDefinition.ReplyConfig globalReplyConfig) Constructs a new ReplyableEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull Button
@NotNull SelectMenu
getSelectMenu
(@NotNull String menu) Gets aStringSelectMenu
orEntitySelectMenu
based on the method name and transforms it into a JDASelectMenu
.void
Removes all components from the original message.@NotNull Message
Acknowledgement of this event with a text message.@NotNull Message
reply
(@NotNull EmbedBuilder builder) Acknowledgement of this event with a text message.@NotNull Message
reply
(@NotNull MessageCreateData message) Acknowledgement of this event with a text message.@NotNull ConfigurableReply
with()
Entry point for configuring a reply.Methods inherited from class com.github.kaktushose.jda.commands.dispatching.events.Event
closeRuntime, getChannel, getChannelIdLong, getEntitlements, getGuild, getIdLong, getJDA, getMember, getToken, getTypeRaw, getUser, getUserLocale, isAcknowledged, jdaEvent, kv, runtimeId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.api.interactions.Interaction
getChannelId, getChannelType, getGuildChannel, getGuildLocale, getMessageChannel, getType, isFromGuild
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getTimeCreated
-
Field Details
-
definition
-
-
Constructor Details
-
ReplyableEvent
protected ReplyableEvent(T event, InteractionRegistry interactionRegistry, com.github.kaktushose.jda.commands.dispatching.Runtime runtime, InteractionDefinition definition, InteractionDefinition.ReplyConfig globalReplyConfig) Constructs a new ReplyableEvent.- Parameters:
event
- the subtypeReplyableEvent
ofGenericInteractionCreateEvent
interactionRegistry
- the correspondingInteractionRegistry
runtime
- theRuntime
this event lives indefinition
- theInteractionDefinition
this event belongs to
-
-
Method Details
-
removeComponents
public void removeComponents()Removes all components from the original message.
The original message is the message, from which this event (interaction) originates. For example if this event is a ButtonEvent, the original message will be the message to which the pressed button is attached to.
-
getButton
-
getSelectMenu
Gets a
StringSelectMenu
orEntitySelectMenu
based on the method name and transforms it into a JDASelectMenu
.The select menu will be linked to the current
Runtime
. This may be useful if you want to send a component without using the framework.- Parameters:
menu
- the name of the select menu- Returns:
- the JDA
SelectMenu
-
with
Entry point for configuring a reply.
Returns a new
ConfigurableReply
that can be used to append components or override reply settings.- Returns:
ConfigurableReply
-
reply
-
reply
Description copied from interface:Reply
Acknowledgement of this event with a text message.- Specified by:
reply
in interfaceReply
- Parameters:
message
- theMessageCreateData
to send- Returns:
- the
Message
that got created
-
reply
Description copied from interface:Reply
Acknowledgement of this event with a text message.- Specified by:
reply
in interfaceReply
- Parameters:
builder
- theEmbedBuilder
to send- Returns:
- the
Message
that got created
-