Search in sources :

Example 1 with MessageEvent

use of co.aurasphere.botmill.fb.event.message.MessageEvent in project fb-botmill by BotMill.

the class BuyButtonTest method defineBehaviour.

/*
	 * (non-Javadoc)
	 * 
	 * @see co.aurasphere.botmill.fb.FbBotDefinition#defineBehavior()
	 */
public void defineBehaviour() {
    // loads the annotated encryption class.
    ConfigurationUtils.loadEncryptedConfigurationProperties();
    // loads the annotated bot.
    ConfigurationUtils.loadBotDefinitions();
    addActionFrame(new MessageEvent(MESSAGE_TO_SEND), new AutoReply() {

        @Override
        public FbBotMillResponse createResponse(MessageEnvelope envelope) {
            return ReplyFactory.addGenericTemplate().addElement("A simple Button Template with a Buy Button").addButton(ButtonFactory.createBuyButton("buy_button_payload").setPaymentSummary("USD", PaymentType.FIXED_AMOUNT, "BotMill.io").addPriceLabel("A price label", "2").setTestPayment(true).addRequestedUserInfo(RequestedUserInfo.CONTACT_PHONE).build()).endElement().build(envelope);
        }
    });
}
Also used : AutoReply(co.aurasphere.botmill.fb.autoreply.AutoReply) FbBotMillResponse(co.aurasphere.botmill.fb.model.outcoming.FbBotMillResponse) MessageEvent(co.aurasphere.botmill.fb.event.message.MessageEvent) MessageEnvelope(co.aurasphere.botmill.fb.model.incoming.MessageEnvelope)

Aggregations

AutoReply (co.aurasphere.botmill.fb.autoreply.AutoReply)1 MessageEvent (co.aurasphere.botmill.fb.event.message.MessageEvent)1 MessageEnvelope (co.aurasphere.botmill.fb.model.incoming.MessageEnvelope)1 FbBotMillResponse (co.aurasphere.botmill.fb.model.outcoming.FbBotMillResponse)1