I have created some Telegram inline buttons with a for
loop.
for ($i = 1; $i < 35; $i++) {
$arr[] = array(array(
"text" => $i,
"callback_data" => "Test_".$i,
));
}
$bot->sendKeyboard($chat_id, $reply, $arr);
public function sendKeyboard($chat_id, $text, $keyboard = Array())
{
$action = 'sendMessage';
$param = array(
'chat_id' => $chat_id,
'reply_markup' => json_encode(array("keyboard" => $keyboard, "one_time_keyboard" => true, "resize_keyboard" => true)),
'text' => $text
);
$res = $this->send($action, $param);
if (!$res['ok']) {
$result = Array("success" => 0, "info" => "Error: " . $res['description']);
} else {
$result = Array("success" => 1, "info" => "Keyboard show");
}
return $result;
}
E.g. the Button-Text is 6, I want Telegram to write Test_6
in chat.
What do I have to change so that a different text than that on the button is output?