TelegramBot / Api

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

Object of class TelegramBot\Api\Types\Inline\InlineKeyboardMarkup could not be converted to int #397

Open luxueqi1234 opened 1 year ago

luxueqi1234 commented 1 year ago

image i only try a test

amu1433 commented 1 year ago

I some question , i need help

luxueqi1234 commented 1 year ago

lost a param $bot->sendmessage($chatId,$messageText, null, false, null, null,$keyboard)

luxueqi1234 commented 1 year ago

I some question , i need help

add a null in front of $keyboard

bernard-ng commented 1 year ago

@amu1433 Sorry for the late reply, did you solve your problem?

BoShurik commented 1 year ago

For php ^8.0 you can use named arguments:

$api->sendMessage(
    chatId: $update->getMessage()->getChat()->getId(),
    text: $text,
    replyMarkup: new InlineKeyboardMarkup(/**/),
);