TelegramBot / Api

Native PHP Wrapper for Telegram BOT API
MIT License
1.06k stars 324 forks source link

Default value for $inlineKeyboard #398

Closed nullform closed 1 year ago

nullform commented 1 year ago

Default value for $inlineKeyboard to allow the constructor to be called with no arguments.

It because we have Fatal error: Uncaught ArgumentCountError: Too few arguments to function TelegramBot\Api\Types\Inline\InlineKeyboardMarkup::__construct() for this code (PHP 8.2):

$keyboard = new \TelegramBot\Api\Types\Inline\InlineKeyboardMarkup(
            [
                [
                    ['text' => 'link', 'url' => 'https://core.telegram.org/']
                ]
            ]
        );        
$bot->sendMessage($chatId, $messageText, null, false, null, $keyboard);
DJafari commented 1 year ago

when this pull request merged ? this is critical bug

bernard-ng commented 1 year ago

@iGusev please could you have a look