public class ConfirmReactionDecorator extends SafeAutoDestroyDisposableReactionDecorator
Modifier and Type | Field and Description |
---|---|
static net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote |
DEFAULT_NO_EMOTE
The default "no" emote.
|
static net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote |
DEFAULT_YES_EMOTE
The default "yes" emote.
|
deleteAfter
buttons
binding, creationTime, isAlive, listener, listeners, timeout
Constructor and Description |
---|
ConfirmReactionDecorator(net.dv8tion.jda.core.entities.Message binding,
long timeout,
DecoratorButton yesButton,
DecoratorButton noButton,
com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout,
boolean deleteAfter)
Create a confirm decorator with custom buttons.
|
ConfirmReactionDecorator(net.dv8tion.jda.core.entities.Message binding,
long timeout,
net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote yesEmote,
net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote noEmote,
com.jesus_crie.modularbot.core.utils.SerializableBiConsumer<ConfirmReactionDecorator,java.lang.Boolean> onTrigger,
com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout,
boolean deleteAfter)
Create a confirm decorator with custom emotes and a common action for both buttons.
|
ConfirmReactionDecorator(net.dv8tion.jda.core.entities.Message binding,
long timeout,
com.jesus_crie.modularbot.core.utils.SerializableBiConsumer<ConfirmReactionDecorator,java.lang.Boolean> onTrigger,
com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout,
boolean deleteAfter)
Create a confirm decorator with the default emotes and a common action for both buttons.
|
ConfirmReactionDecorator(net.dv8tion.jda.core.entities.Message binding,
long timeout,
com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onYes,
com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onNo,
com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout,
boolean deleteAfter)
Create a confirm decorator with the default emotes and custom actions for each choice.
|
Modifier and Type | Method and Description |
---|---|
protected void |
onTimeout()
Triggered when the decorator times out.
|
onTrigger
createListener, destroy, destroyButtons, setup
checkTimeout, equals, getBinding, getExpireTime, isAlive, register, register, toString, updateMessage
public static final net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote DEFAULT_YES_EMOTE
public static final net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote DEFAULT_NO_EMOTE
public ConfirmReactionDecorator(@Nonnull net.dv8tion.jda.core.entities.Message binding, long timeout, @Nonnull com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onYes, @Nullable com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onNo, @Nullable com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout, boolean deleteAfter)
binding
- The bound message.timeout
- The amount of time in milliseconds before the decorator times out, or 0 for infinite.onYes
- The action to perform when the "yes" button is triggered.onNo
- (Optional) The action to perform when the "no" button is triggered.onTimeout
- (Optional) The action to perform when the decorator times out.deleteAfter
- Whether the message should be deleted when the decorator is being destroyed.public ConfirmReactionDecorator(@Nonnull net.dv8tion.jda.core.entities.Message binding, long timeout, @Nonnull com.jesus_crie.modularbot.core.utils.SerializableBiConsumer<ConfirmReactionDecorator,java.lang.Boolean> onTrigger, @Nullable com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout, boolean deleteAfter)
binding
- The bound message.timeout
- The amount of time in milliseconds before the decorator times out, or 0 for infinite.onTrigger
- The action to perform when one of the buttons is triggered.onTimeout
- The action to perform when the decorator times out.deleteAfter
- Whether the message should be deleted when the decorator is being destroyed.public ConfirmReactionDecorator(@Nonnull net.dv8tion.jda.core.entities.Message binding, long timeout, @Nonnull net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote yesEmote, @Nonnull net.dv8tion.jda.core.entities.MessageReaction.ReactionEmote noEmote, @Nonnull com.jesus_crie.modularbot.core.utils.SerializableBiConsumer<ConfirmReactionDecorator,java.lang.Boolean> onTrigger, @Nullable com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout, boolean deleteAfter)
binding
- The bound message.timeout
- The amount of time in milliseconds before the decorator times out, or 0 for infinite.yesEmote
- The emote for the "yes" button.noEmote
- The emote for the "no" button.onTrigger
- The action to trigger when one of the buttons is triggered.onTimeout
- The action to perform when the decorator times out.deleteAfter
- Whether the message should be deleted when the decorator is being destroyed.public ConfirmReactionDecorator(@Nonnull net.dv8tion.jda.core.entities.Message binding, long timeout, @Nonnull DecoratorButton yesButton, @Nonnull DecoratorButton noButton, @Nullable com.jesus_crie.modularbot.core.utils.SerializableConsumer<ConfirmReactionDecorator> onTimeout, boolean deleteAfter)
binding
- The bound message.timeout
- The amount of time in milliseconds before the decorator times out, or 0 for infinite.yesButton
- The "yes" button and its action.noButton
- The "no" button and its action.onTimeout
- The action to perform when the decorator times out.deleteAfter
- Whether the message should be deleted when the decorator is being destroyed.protected void onTimeout()
MessageDecorator
On the other hand, an implementation like ReactionDecorator
will call MessageDecorator.destroy()
on timeout which is an expected behaviour.
onTimeout
in class SafeAutoDestroyDisposableReactionDecorator