I\'m trying to make a Telegram Bot in PHP with a custom keyboard. The message is delivered, but the custom keyboard won\'t work. $keyb = array(\'keyboard\' => array(array
$keyboard = array(array("[Destaques]","[Campinas e RMC]","[esportes]"));
$resp = array("keyboard" => $keyboard,"resize_keyboard" => true,"one_time_keyboard" => true);
$reply = json_encode($resp);
$url = $GLOBALS[website]."/sendmessage?chat_id=".$chatId."&text=oi&reply_markup=".$reply;
file_get_contents($url);
This code works fine!
The docs seem to indicate you need to provide the reply_markup parameter as a JSON serialised object... kinda stupid for a form POST endpoint:
$replyMarkup = array(
'keyboard' => array(
array("A", "B")
)
);
$encodedMarkup = json_encode($replyMarkup);
$content = array(
'chat_id' => <chat_id>,
'reply_markup' => $encodedMarkup,
'text' => "Test"
);
Does this one work?