botman / driver-facebook

BotMan Facebook Messenger Driver
MIT License
71 stars 73 forks source link

generic template add quick reply button #104

Closed hawkcraw closed 4 years ago

hawkcraw commented 4 years ago

generic template add quick reply button

e.g.

$bot->reply(GenericTemplate::create()
            ->addImageAspectRatio(GenericTemplate::RATIO_SQUARE)
            ->addElements([
                Element::create('BotMan Documentation')
                    ->subtitle('All about BotMan')
                    ->image('http://botman.io/img/botman-body.png')
                    ->addButton(ElementButton::create('visit')
                        ->url('http://botman.io')
                    )
                    ->addButton(ElementButton::create('tell me more')
                        ->payload('tellmemore')
                        ->type('postback')
                    ),
                Element::create('BotMan Laravel Starter')
                    ->subtitle('This is the best way to start with Laravel and BotMan')
                    ->image('http://botman.io/img/botman-body.png')
                    ->addButton(ElementButton::create('visit')
                        ->url('https://github.com/mpociot/botman-laravel-starter')
                    ),
            ])
            ->addQuickReply(QuickReplyButton::create('title')->payload('POSTBACK_PAYLOAD'))
            ->addQuickReply(QuickReplyButton::create()->type('user_phone_number'))
            ->addQuickReply(QuickReplyButton::create()->type('user_email'))
        );
feralheart commented 4 years ago

Hi @hawkcraw, Thank you for your contribution!