pimax / fb-messenger-php

Facebook Messenger Bot PHP API
GNU General Public License v2.0
314 stars 147 forks source link

Help/Guide on list implementaion #88

Closed ngethe closed 7 years ago

ngethe commented 7 years ago

Help with Example useage on list I tried this

           case 'g':
                $bot->send(new StructuredMessage($message['sender']['id'],
                    StructuredMessage::TYPE_LIST,
                    [
                        'elements' => [
                            new MessageElement("top_element_style", "large", "image_url","https://www.hello.com/img_/hello_logo_hero.png" , [
                                new MessageButton(MessageButton::TYPE_POSTBACK, 'First button'),
                                new MessageButton(MessageButton::TYPE_WEB, 'Web link', 'http://facebook.com')
                            ]),
                            new MessageElement("Second item", "Item description", "",  "image_url","https://www.hello.com/img_/hello_logo_hero.png",  [
                                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')
                            ])
                        ]
                    ]
                ));

            break;

But NOT working

ngethe commented 7 years ago

Am I doing something wrong on the this implementation??

wittfabian commented 7 years ago

use the new example