public class Chat extends BasicSense
Modifier and Type | Field and Description |
---|---|
static int |
LAST_USERS |
static int |
MAX_SPAM |
static int |
SLEEP |
conversations, DAY, DEFAULT_SPEAKER, engaged, HOUR, MAX_FILE_SIZE, MINUTE, RETRY
Constructor and Description |
---|
Chat() |
Modifier and Type | Method and Description |
---|---|
void |
addLastUser(java.lang.String user) |
void |
addUser(java.lang.String user) |
boolean |
checkSpam(java.lang.String user,
java.lang.String text)
Ignore users that spam the same message repeatedly.
|
void |
connect() |
void |
disconnect() |
ChatListener |
getChatListener() |
Vertex |
getConversation(Network network)
Return the current conversation.
|
java.lang.String |
getNick() |
java.lang.String |
getNick(Vertex output) |
java.lang.String |
getNickAlt() |
java.util.Map<java.lang.String,java.lang.String> |
getUserNicks() |
java.util.Set<java.lang.String> |
getUsers() |
void |
initialize() |
void |
input(java.lang.Object inputText,
Network network)
Process the input chat event.
|
void |
inputSentence(java.lang.String text,
java.lang.String userName,
java.util.List<java.lang.String> targetUserNames,
boolean isGreet,
boolean isWhisper,
Network network)
Process the text sentence.
|
boolean |
isConnected() |
void |
output(Vertex output)
Output the vertex to text.
|
void |
pool()
Reset state when instance is pooled.
|
void |
removeUser(java.lang.String user) |
void |
setChatListener(ChatListener chatListener) |
void |
setConnected(boolean isConnected) |
void |
setConversation(Vertex conversation)
Set the current conversation.
|
void |
setNick(java.lang.String nick) |
void |
setNickAlt(java.lang.String nickAlt) |
void |
setUserNicks(java.util.Map<java.lang.String,java.lang.String> userNicks) |
void |
setUsers(java.util.Set<java.lang.String> users) |
void |
shutdown()
Stop sensing.
|
java.lang.String |
trimSpecialChars(java.lang.String text)
Trim special IRC command chars from the text.
|
java.lang.String |
trimUserName(java.lang.String text)
Trim non-letters and lower case.
|
addListener, awake, checkEngaged, checkSentence, discover, discoverSentence, getAction, getBot, getEmotionalState, getLanguageState, getListeners, getName, getPrimitive, getResponseListener, getShortTermMemory, initialize, input, isEnabled, log, log, log, migrateProperties, notifyExceptionListeners, notifyResponseListener, printInput, removeListener, saveProperties, setAction, setBot, setEmotionalState, setIsEnabled, setLanguageState, setName, setResponseListener, toString
public static int SLEEP
public static int MAX_SPAM
public static int LAST_USERS
public ChatListener getChatListener()
public void setChatListener(ChatListener chatListener)
public void initialize()
public void connect()
public void shutdown()
shutdown
in interface Sense
shutdown
in class BasicSense
public void pool()
pool
in interface Sense
pool
in class BasicSense
public void disconnect()
public java.lang.String trimSpecialChars(java.lang.String text)
public java.lang.String trimUserName(java.lang.String text)
public void input(java.lang.Object inputText, Network network)
input
in interface Sense
input
in class BasicSense
public boolean checkSpam(java.lang.String user, java.lang.String text)
public void inputSentence(java.lang.String text, java.lang.String userName, java.util.List<java.lang.String> targetUserNames, boolean isGreet, boolean isWhisper, Network network)
public void output(Vertex output)
output
in interface Sense
output
in class BasicSense
public java.lang.String getNick(Vertex output)
public void addLastUser(java.lang.String user)
public java.lang.String getNick()
public void setNick(java.lang.String nick)
public java.lang.String getNickAlt()
public void setNickAlt(java.lang.String nickAlt)
public void addUser(java.lang.String user)
public void removeUser(java.lang.String user)
public java.util.Set<java.lang.String> getUsers()
public void setUsers(java.util.Set<java.lang.String> users)
public boolean isConnected()
public void setConnected(boolean isConnected)
public java.util.Map<java.lang.String,java.lang.String> getUserNicks()
public void setUserNicks(java.util.Map<java.lang.String,java.lang.String> userNicks)
public void setConversation(Vertex conversation)