Answer the question
In order to leave comments, you need to log in
Do you get an error when adding buttons in the VK chatbot?
I want to try out the buttons in VK. From the beginning, I made a simple message sending according to the guide:
public function send_message($peer_id,$text){
$request_params = [
'message' => $text,
'peer_id' => $peer_id,
'access_token' => $this->token,
'v' => '5.50',
];
$get_params = http_build_query($request_params);
file_get_contents('https://api.vk.com/method/messages.send?'. $get_params);
}
$request_params = [
'message' => $text,
'peer_id' => $peer_id,
'access_token' => $this->token,
'v' => '5.50',
'keyboard' => [
'one_time' => false,
'buttons' => [
[
'action' => [
'type' => 'text',
'payload' => '{\"button\": \"1\"}',
'label' => 'negative'
],
'color' => 'negative'
]
]
]
];
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