public abstract class ReactionDecorator extends MessageDecorator<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent>
Modifier and Type | Field and Description |
---|---|
protected java.util.List<DecoratorButton> |
buttons |
binding, creationTime, isAlive, listener, listeners, timeout
Modifier | Constructor and Description |
---|---|
protected |
ReactionDecorator(net.dv8tion.jda.core.entities.Message binding,
long timeout,
DecoratorButton... buttons)
Initialize the decorator.
|
Modifier and Type | Method and Description |
---|---|
protected com.jesus_crie.modularbot.core.utils.Waiter.WaiterListener<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent> |
createListener(java.lang.Object... args)
Used to create the listener.
|
void |
destroy()
Destroy the decorator.
|
void |
destroyButtons()
Remove the reaction of the button.
|
protected void |
onTimeout()
Triggered when the decorator times out.
|
protected boolean |
onTrigger(net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent event)
Called when the decorator is triggered.
|
void |
setup()
Used to setup the decorator, this must be triggered out of the constructor.
|
checkTimeout, equals, getBinding, getExpireTime, isAlive, register, register, toString, updateMessage
protected final java.util.List<DecoratorButton> buttons
protected ReactionDecorator(@Nonnull net.dv8tion.jda.core.entities.Message binding, long timeout, @Nonnull DecoratorButton... buttons)
binding
- The bound message.timeout
- The amount of milliseconds before this decorator expire or 0 for infinite.buttons
- The buttons (reaction) that can trigger this decorator.MessageDecorator
public void setup()
setup
in class MessageDecorator<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent>
@Nonnull protected com.jesus_crie.modularbot.core.utils.Waiter.WaiterListener<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent> createListener(@Nonnull java.lang.Object... args)
MessageDecorator
createListener
in class MessageDecorator<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent>
protected boolean onTrigger(@Nonnull net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent event)
event
- The event that was thrown.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 MessageDecorator<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent>
public void destroyButtons()
destroy()
.public void destroy()
MessageDecorator
The effect of this method might depend of the implementation.
Depending of the implementation this method can also be called as a result of MessageDecorator.onTimeout()
.
destroy
in class MessageDecorator<net.dv8tion.jda.core.events.message.react.GenericMessageReactionEvent>