public void sendPayload ( String payload ) { MessageEnvelope envelope = new MessageEnvelope ( ) ; Postback postback = new Postback ( ) ; postback . setPayload ( payload ) ; envelope . setPostback ( postback ) ; envelope . setSender ( new User ( facebookMockId ) ) ; System . out . println ( "Sending payload: [" + payload + "] as user : [" + facebookMockId + "]." ) ; forward ( envelope ) ; System . out . println ( "Sent!" ) ; }
Sends a payload to all the registered bots . Used to simulate a user interacting with buttons .