Integrated ChatCommand#awaitAnswer
This commit is contained in:
parent
d306d8dca2
commit
f6a84dd011
@ -1,8 +1,11 @@
|
||||
package de.gnmyt.autoresponder.entities;
|
||||
|
||||
import de.gnmyt.autoresponder.event.chat.ChatMessageReceivedEvent;
|
||||
import de.gnmyt.autoresponder.http.contexts.ResponderContext;
|
||||
import de.gnmyt.autoresponder.http.controller.HttpResponseController;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class ChatCommand extends Command {
|
||||
|
||||
private final String sender;
|
||||
@ -25,6 +28,15 @@ public class ChatCommand extends Command {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits until a new message has been sent
|
||||
*
|
||||
* @param then The action that should be executed after the message has been sent
|
||||
*/
|
||||
public void awaitAnswer(Consumer<ChatMessageReceivedEvent> then) {
|
||||
getResponderContext().LOCKED_CHANNELS.add(new LockedChannel(null, false, getSender(), then));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the sender
|
||||
*
|
||||
|
Reference in New Issue
Block a user