botman / driver-telegram

BotMan Telegram Driver

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add an option to disable auto hiding keyboard

kubk opened this issue · comments

Now Telegram driver automatically hides keyboard for interactive messages:

public function messagesHandled()
{
$callback = $this->payload->get('callback_query');
if ($callback !== null) {
$callback['message']['chat']['id'];
$this->removeInlineKeyboard($callback['message']['chat']['id'],
$callback['message']['message_id']);
}
}

This method is called here:
https://github.com/botman/botman/blob/0afbda1ad742dd369b0b1368104b6d3462118262/src/BotMan.php#L408-L409

For my case it is required to prevent hiding keyboard, but I did not find a way to do this without extending TelegramDriver and overriding messagesHandled. My suggestion is to add an option to TelegramDriver config, for example 'hideKeyboard' => true (default) and hide a keyboard only if this parameter is set to true. Can make a PR.