Botman: how create two rows inline button telegram

Created on 18 Sep 2018  路  4Comments  路  Source: botman/botman

  • BotMan Version: 2.0
  • PHP Version: 7.2
  • Messaging Service(s): telegram
  • Cache Driver: doctrain

Description:

come back with new issue :/
how create two rows inline button telegram?
i use this, but its one row!
$question = Question::create('qusetions? ') ->callbackId('askCarStatus') ->addButtons([ Button::create('q1')->value('q1'), Button::create('q2')->value('q3'), Button::create('q3')->value('q3'), Button::create('q4')->value('q4'), ]);

Steps To Reproduce:

Most helpful comment

hi. How to get callbackData ???

All 4 comments

Hey, in Telegram you have the default buttons like you have used and you have the concept of a keyboard. There you can create rows and buttons as you wish. It works like that, see below.

But please use the BotMan Slack channel for such questions. Here on GitHub, it is about issued with the framework. Thanks and hope that helps.

$keyboard = Keyboard::create(Keyboard::TYPE_INLINE)->oneTimeKeyboard()
        ->addRow(KeyboardButton::create('Shutter Island')->callbackData('1'))
        ->addRow(KeyboardButton::create('The Wolf Of Wall Street')->callbackData('1'))
        ->addRow(KeyboardButton::create('The Revenant')->callbackData('1'))
        ->addRow(KeyboardButton::create('Inception')->callbackData('1'));

tnx, but can i use this in ask function? if yeah ,
how ? :/

Yes you can, just like $this->ask($keyboard, ...

hi. How to get callbackData ???

Was this page helpful?
0 / 5 - 0 ratings