botman / driver-telegram

BotMan Telegram Driver
MIT License
86 stars 75 forks source link

Ability to set reply_markup manually for question in params #83

Closed vdomah closed 1 month ago

vdomah commented 4 years ago

Hi! This is simple commit to allow defining reply_markup parameter manually when doing ask() in conversation. This doesn't change any existing behavior. Just allows freely configure my desired keyboard if needed custom solution.

For example, I use it this way:

$question = Question::create($text);

$columns_number = count($menu) / 2;
$parameters['reply_markup'] = ConversationHelper::instance()->getKeyboard($question, $columns_number, Keyboard::TYPE_KEYBOARD);

$this->ask($question, $this->defaultQuestionCallback(), $parameters);

Also I got plans to implement other reply markup features so for now doing the minimum PR for that later purpose. Thanks!