public class FbBot extends Object
FbBotMillEvent. An event is a callback from Facebook Messenger
Platform. There may be different events, according to what your app has
registered for (for more info check the link below). At each callback
received from Facebook, all registered bots callbacks handler are checked. If
any callback condition is verified, then the handleCallback method is called.| Constructor and Description |
|---|
FbBot()
Instantiates a new FbBot with a default policy of
FbBotMillPolicy.FIRST_ONLY. |
FbBot(FbBotMillPolicy fbBotMillPolicy)
Instantiates a new FbBot.
|
| 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. |
boolean |
equals(Object obj) |
int |
hashCode() |
void |
processMessage(MessageEnvelope envelope)
Checks if there's any registered
FbBotMillEvent for the incoming
callback. |
String |
toString() |
public FbBot()
FbBotMillPolicy.FIRST_ONLY.public FbBot(FbBotMillPolicy fbBotMillPolicy)
fbBotMillPolicy - the fbBotMillPolicy.public 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.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 FbBotMillPolicy followed by this bot.
If the policy is FbBotMillPolicy.FIRST_ONLY, the chain will be
processed until the first callback matches. Otherwise, if the policy is
FbBotMillPolicy.PROCESS_ALL, all the chain will always be
processed.envelope - the incoming message.Copyright © 2017 BotMill. All rights reserved.