Closed michelpf closed 8 years ago
Using the follow example
$buttons = [new Button('Click', Button::TYPE_WEB, 'www.seuapp.com.br'),new Button('Click2', Button::TYPE_POSTBACK, 'HELP')]; $bot->sendButton($usuario, 'Example text... Not too long, hehe.', $buttons);
The 'Click2' button will send to the webhook the string 'HELP'. How to catch that in order to trigger a message, for example?
I manage to work, it's just simple put:
if (empty($mensagem)){ $mensagem = $messages[0]->messaging[0]->postback->payload; }
Using the follow example
$buttons = [new Button('Click', Button::TYPE_WEB, 'www.seuapp.com.br'),new Button('Click2', Button::TYPE_POSTBACK, 'HELP')]; $bot->sendButton($usuario, 'Example text... Not too long, hehe.', $buttons);
The 'Click2' button will send to the webhook the string 'HELP'. How to catch that in order to trigger a message, for example?