public class AiCommandListener extends java.lang.Object implements ChatListener
Constructor and Description |
---|
AiCommandListener(SymphonyClient symClient) |
Modifier and Type | Method and Description |
---|---|
boolean |
addCommand(AiCommand command) |
java.util.ArrayList<AiCommand> |
getActiveCommands() |
SymMessage |
getLastAnsweredMessage() |
SymphonyClient |
getSymClient() |
static boolean |
isCommand(SymMessage message,
SymphonyClient symClient)
A method that allows other classes to determine if a given message
matches a command in this command listener
|
void |
listenOn(Chat chat)
Registers this listener to a given chat appropriately.
|
void |
onChatMessage(SymMessage message)
When a chat message is received, check if it starts with
the command char.
|
boolean |
removeCommand(AiCommand command) |
void |
stopListening(Chat chat)
Removes this listener from the provided chat appropriately
|
public AiCommandListener(SymphonyClient symClient)
public static boolean isCommand(SymMessage message, SymphonyClient symClient)
message
- the messagesymClient
- Symphony clientpublic void onChatMessage(SymMessage message)
onChatMessage
in interface ChatListener
message
- the received messagepublic void listenOn(Chat chat)
chat
- The chat to listen onpublic void stopListening(Chat chat)
chat
- The chat to listen onpublic java.util.ArrayList<AiCommand> getActiveCommands()
public boolean addCommand(AiCommand command)
public boolean removeCommand(AiCommand command)
public SymphonyClient getSymClient()
public SymMessage getLastAnsweredMessage()