public abstract class FbBot extends Object implements co.aurasphere.botmill.core.BotDefinition
BotDefinition implementation.| Constructor and Description |
|---|
FbBot()
Base constructor.
|
FbBot(co.aurasphere.botmill.core.BotMillPolicy botmillPolicy)
Base constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionFrame(ActionFrame actionFrame)
Adds an
ActionFrame to this bot. |
void |
addActionFrame(FbBotMillEvent event,
AutoReply... replies)
Adds an
ActionFrame to this bot with multiple reply. |
void |
addActionFrame(FbBotMillEvent event,
AutoReply reply)
Adds an
ActionFrame to this bot. |
protected void |
addReply(AutoReply reply)
Adds the reply.
|
protected co.aurasphere.botmill.core.BotMillSession |
botMillSession()
Bot mill session.
|
void |
defineBehaviour()
This is the method to define the behaviour of the bot.
|
boolean |
equals(Object obj) |
protected void |
executeReplies()
Execute replies.
|
MessageEnvelope |
getEnvelope() |
FbBotMillEvent |
getEvent() |
int |
hashCode() |
void |
processMessage(MessageEnvelope envelope)
Checks if there's any registered
FbBotMillEvent for the incoming
callback. |
protected void |
reply(AutoReply... replies)
This method is used to create multiple replies.
|
protected void |
reply(AutoReply reply)
This method is used to create a reply.
|
void |
setEnvelope(MessageEnvelope envelope)
Sets the envelope.
|
void |
setEvent(FbBotMillEvent event)
Sets the event.
|
public FbBot(co.aurasphere.botmill.core.BotMillPolicy botmillPolicy)
botmillPolicy - the policy this bot should follow.public FbBot()
public void setEvent(FbBotMillEvent event)
event - the new eventpublic FbBotMillEvent getEvent()
public void setEnvelope(MessageEnvelope envelope)
envelope - the new envelopepublic MessageEnvelope getEnvelope()
public void defineBehaviour()
defineBehaviour in interface co.aurasphere.botmill.core.BotDefinitionpublic void addActionFrame(ActionFrame actionFrame)
ActionFrame to this bot.actionFrame - the actionFrame to add.public void addActionFrame(FbBotMillEvent event, AutoReply reply)
ActionFrame to this bot.event - the FbBotMillEvent to handle.reply - the AutoReply which should handle the event.public void addActionFrame(FbBotMillEvent event, AutoReply... replies)
ActionFrame to this bot with multiple reply.event - the FbBotMillEvent to handle.replies - the collection of AutoReply which should handle the
event.protected void reply(AutoReply... replies)
replies - the set of replies in a form of a var-argsprotected final co.aurasphere.botmill.core.BotMillSession botMillSession()
protected void reply(AutoReply reply)
reply - the replyprotected void addReply(AutoReply reply)
reply - the replyprotected void executeReplies()
public void processMessage(MessageEnvelope envelope)
FbBotMillEvent for the incoming
callback. If there's any, then the callback is handled. The chain will be
processed according to the BotMillPolicy followed by this bot. If
the policy is BotMillPolicy.FIRST_ONLY, the chain will be
processed until the first callback matches. Otherwise, if the policy is
BotMillPolicy.PROCESS_ALL, all the chain will always be
processed.envelope - the incoming message.Copyright © 2017 BotMill. All rights reserved.