Answer the question
In order to leave comments, you need to log in
After the callback is called, the script is run again. Telegram bot api, inline keyboard?
There is a script that sends a message with an inline keyboard, when pressed, another message should come. But it turns out that after pressing the keyboard, the script works from the very beginning, sending everything again.
$inline_button1 = array("text"=>"Принять заявку","callback_data"=>"/take");
$inline_keyboard = ;
$keyboard=array("inline_keyboard"=>$inline_keyboard);
$replyMarkup = json_encode($keyboard);
$msg = "новая заявка например";
sendMessage($chat_id,$msg, $replyMarkup);
switch($data){
case '/take':
$take_msg = "Заявка принята ".$callback_user;
sendReply($chat_id, $take_msg, $message_id);
break;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question