Closed Yiidiir closed 7 years ago
Was ist deine Frage? Was genau machst du? Welche Fehler werden angezeigt?
Nur fixiert!
Scheint wie die QuickReplyButton Objekte erfordert eine Nutzlast (wir können nicht nur Text senden .. es sei denn, wir setzen '' als Parameter am Ende).
This worked for me :
$bot->send(new QuickReply($message['sender']['id'], 'TEXT ', [ new QuickReplyButton(QuickReplyButton::TYPE_TEXT, 'First button',' THIS PARAM is required, atleast put a whitespace!') ] ));
Should work
$bot->send(new StructuredMessage($message['sender']['id'],
StructuredMessage::TYPE_GENERIC,
[
'elements' => [
new MessageElement("First item", "Item description", "", [
new MessageButton(MessageButton::TYPE_POSTBACK, 'First button'),
new MessageButton(MessageButton::TYPE_WEB, 'Web link', 'http://facebook.com')
]),
new MessageElement("Second item", "Item description", "", [
new MessageButton(MessageButton::TYPE_POSTBACK, 'First button'),
new MessageButton(MessageButton::TYPE_POSTBACK, 'Second button')
]),
new MessageElement("Third item", "Item description", "", [
new MessageButton(MessageButton::TYPE_POSTBACK, 'First button'),
new MessageButton(MessageButton::TYPE_POSTBACK, 'Second button')
])
]
],
[
new QuickReplyButton(QuickReplyButton::TYPE_TEXT, 'First button', 'THIS PARAM is required, atleast put a whitespace!')
]
));
Couldn't implement the new added type of buttons/reply (with the MessageElement object) : QuickReply, the example file isn't updated neither.