Search in sources :

Example 1 with QuickReply

use of co.aurasphere.botmill.fb.model.outcoming.quickreply.QuickReply 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!");
}
Also used : User(co.aurasphere.botmill.fb.model.base.User) QuickReply(co.aurasphere.botmill.fb.model.outcoming.quickreply.QuickReply) ReceivedMessage(co.aurasphere.botmill.fb.model.incoming.callback.ReceivedMessage) MessageEnvelope(co.aurasphere.botmill.fb.model.incoming.MessageEnvelope)

Aggregations

User (co.aurasphere.botmill.fb.model.base.User)1 MessageEnvelope (co.aurasphere.botmill.fb.model.incoming.MessageEnvelope)1 ReceivedMessage (co.aurasphere.botmill.fb.model.incoming.callback.ReceivedMessage)1 QuickReply (co.aurasphere.botmill.fb.model.outcoming.quickreply.QuickReply)1