use of co.aurasphere.botmill.fb.model.incoming.callback.ReceivedMessage in project fb-botmill by BotMill.
the class FbBotMillMockMediator method sendTextMessage.
/**
* Sends a text message to all the registered bots. Used to simulate a user
* typing in chat with your bot.
*
* @param message
* the message to send.
*/
public void sendTextMessage(String message) {
MessageEnvelope envelope = new MessageEnvelope();
ReceivedMessage body = new ReceivedMessage();
body.setText(message);
envelope.setMessage(body);
envelope.setSender(new User(facebookMockId));
System.out.println("Sending message: [" + message + "] as user : [" + facebookMockId + "].");
forward(envelope);
System.out.println("Sent!");
}
use of co.aurasphere.botmill.fb.model.incoming.callback.ReceivedMessage in project fb-botmill by BotMill.
the class FbBotMillMockMediator method sendQuickReplyPayload.
/**
* Sends a quickreply to all the registered bots. Used to simulate a user
* interacting with buttons.
*
* @param payload
* the payload to send.
*/
public void sendQuickReplyPayload(String payload) {
MessageEnvelope envelope = new MessageEnvelope();
QuickReply quickReply = new QuickReply("Sample", payload);
ReceivedMessage message = new ReceivedMessage();
message.setQuickReply(quickReply);
envelope.setMessage(message);
envelope.setSender(new User(facebookMockId));
System.out.println("Sending quick reply: [" + message + "] as user : [" + facebookMockId + "].");
forward(envelope);
System.out.println("Sent!");
}
Aggregations