|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Bot
Interface that any coweb bot must define.
| Method Summary | |
|---|---|
void |
init()
The bot Proxy will call this method when a new session has been created and a user has subscribed to this bot's service. |
void |
onRequest(Map<String,Object> params,
String replyToken,
String username)
Called when a user make a private request to this bot. |
void |
onShutdown()
Called when the bot service is to shutdown. |
void |
onSubscribe(String username)
Called when a user subscribes to the service provided by this bot. |
void |
onUnsubscribe(String username)
Called when a user unsubscribes to the service provided by this bot. |
void |
setProxy(Proxy proxy)
Sets the proxy object this bot should use to reply to subscribes, sync, requests, etc. |
| Method Detail |
|---|
void init()
void onSubscribe(String username)
username - The username of the client subscribing.void onUnsubscribe(String username)
username - The username of the client unsubscribing.
void onRequest(Map<String,Object> params,
String replyToken,
String username)
params - key value pairs of parameters sent by the user.replyToken - token associated with this request. The bot must
pass this token back to the proxy when replying to this request.username - The username of the client making this request.void onShutdown()
void setProxy(Proxy proxy)
proxy - The proxy object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||