Integrated GroupCommand#awaitAnswer

This commit is contained in:
mathias 2021-10-03 21:44:04 +02:00
parent f6a84dd011
commit b99ebc9e4d
No known key found for this signature in database
GPG Key ID: 8950DF62139C852A

View File

@ -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
*