Keyboard for viber bot php

Viewed 192

I've created a viber bot with this https://github.com/Bogdaan/viber-bot-php and now I want to create a keyboard for it. Demo keyboard looks like this: enter image description here

my bot code is exactly like this: https://github.com/Bogdaan/viber-bot-php/blob/master/examples/bot-plus.php

Buttons are displaying with this part of code:

 $buttons = [];
            for ($i = 0; $i <= 8; $i++) {
                $buttons[] =
                    (new \Viber\Api\Keyboard\Button())
                        ->setColumns(1)
                        ->setActionType('reply')
                        ->setActionBody('k' . $i)
                        ->setText('k' . $i);
            }

But if I change k - bot is not responding I want to change buttons to brands of cars:

global $wpdb;
$makes = $wpdb->prepare("SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = 'make' ",ARRAY_A);
$makes = $wpdb->get_col( $makes );
$makes = array_unique($makes);
$makes = implode( ' ', $makes );
$makes = ucwords ($makes);
echo $makes;
0 Answers
Related