Integrated GroupCommand#awaitAnswer
This commit is contained in:
parent
f6a84dd011
commit
b99ebc9e4d
@ -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 GroupCommand extends Command {
|
||||
|
||||
private final String group;
|
||||
@ -28,6 +31,15 @@ public class GroupCommand extends Command {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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(getGroup(), true, getSender(), then));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the group
|
||||
*
|
||||
|
Reference in New Issue
Block a user