public class ChaturBot
extends java.lang.Object
Constructor and Description |
---|
ChaturBot(java.lang.String roomName,
java.lang.String URL,
java.lang.String connectAuth)
Creates a new instance;
start() must be called to open the
connection. |
Modifier and Type | Method and Description |
---|---|
RoomCount |
getRoomCount()
Queries the server for number of users in room and returns the response
asynchronously inside the
RoomCount object. |
java.lang.String |
getRoomName()
Returns the room name, as specified to the constructor.
|
boolean |
isAuthenticated()
Returns whether the authentication process with the server has succeeded
yet.
|
protected void |
onAuthResponse(com.neovisionaries.ws.client.WebSocket websocket,
java.lang.String message)
Called after authorization.The default implementation joins the channel
specified in this instance's constructor.
|
protected void |
onNotify(Notification notification)
Called when an announcement or tip is sent.
|
protected void |
onNotifyGroupShowCancel()
Called when a group show is cancelled.
|
protected void |
onRoomMsg(RoomMessage message)
Called when a normal chat message is sent.
|
protected void |
onSilence(java.lang.String arg0,
java.lang.String arg1)
Called when a user is timed out by a moderator.
|
protected void |
onTitleChange(java.lang.String newTitle)
Called on stream title change; empty strings are common because of
Chaturbate's implementation.
|
void |
start()
Opens the connection and starts receiving messages from the server.
|
void |
stop()
Closes the connection and stops receiving messages form the server.
|
public ChaturBot(java.lang.String roomName, java.lang.String URL, java.lang.String connectAuth) throws java.io.IOException
start()
must be called to open the
connection.URL
- connectAuth
- roomName
- java.io.IOException
public void start() throws com.neovisionaries.ws.client.WebSocketException
com.neovisionaries.ws.client.WebSocketException
public void stop()
public RoomCount getRoomCount()
RoomCount
object. See the object's
documentation for how to manage the asynchronous nature of the query.java.lang.IllegalStateException
- if start()
has not been called, or
authentication with server is incomplete (see isAuthenticated()
.public boolean isAuthenticated()
public java.lang.String getRoomName()
protected void onAuthResponse(com.neovisionaries.ws.client.WebSocket websocket, java.lang.String message)
super
so that the connection process to the chat is completed.websocket
- message
- - raw text from websocketprotected void onRoomMsg(RoomMessage message)
message
- protected void onTitleChange(java.lang.String newTitle)
newTitle
- protected void onNotify(Notification notification)
Notification
for
more info.notification
- protected void onSilence(java.lang.String arg0, java.lang.String arg1)
arg0
- arg1
- protected void onNotifyGroupShowCancel()