T
T
Timur Dyakov2020-02-17 02:14:17
PHP
Timur Dyakov, 2020-02-17 02:14:17

How to change the name of the buttons in the telegram bot?

Hello, I'm interested in the question of how to change the name of the buttons in the telegram bot so that they are without "/" and that when you click on the button, exactly that command comes out.

function sendMessage($id,$text)
{
    global $api;
    $keyboard =  ;
  $resp = ["keyboard" => $keyboard,"resize_keyboard" => true,"one_time_keyboard" => false];
  $reply = json_encode($resp);
  $query = $api. '/sendMessage?chat_id='. $id .'&reply_markup='.$reply.'&text='.urlencode($text);
  file_get_contents($query);
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Baskakov, 2020-02-17
@dmitrybascacov

https://core.telegram.org/bots/api#inlinekeyboardbutton
You need to use inline_keyboard, or do this And in message processing, perform actions not only with "/help", but also with "help"
$keyboard = ;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question