Как выполнять действие по нажатию кнопки в inline_keyboard

Как нужно передать значение от кнопки что бы бот выполнял действие? Мой код, но не работает.

if (preg_match('/\/say/i', $message['text']) == TRUE) {
                    if (preg_match('/^\/say (|-).+/i', $message['text']) == TRUE) {

                        $query = mysqli_query($connection, "SELECT `telegram` FROM `accounts` WHERE `access` > '0' ");

                        $row = mysqli_fetch_assoc($query);

                        $vowels = array("/say");
                        $onlyconsonants = str_replace($vowels, "", $message['text']);

                        $text = "Ваш текст: \n\n";
                        $text .= $onlyconsonants;

                        $keyboard = json_encode(Array('inline_keyboard' => Array(
                            Array(Array('text' => 'Подтвердить', 'callback_data' => '/yes'),Array('text' => 'Отменить', 'callback_data' => '/no'))
                        )));

                        send($config['token'], 'sendMessage', Array('chat_id' => $message['chat_id'], 'text' => $text, 'parse_mode' => 'HTML', 'reply_markup' => $keyboard));


                        if ($callback_data == '/yes') {
                            while($row = mysqli_fetch_assoc($query)) {
                                    $text1 = $onlyconsonants;
                                    send($config['token'], 'sendMessage', Array('chat_id' => $row['telegram'], 'text' => $text1, 'parse_mode' => 'HTML', 'disable_web_page_preview' => 'true'));
                            }  
                        } elseif ($callback_data == '/no') {
                            $text = "Отменено.";
                            send($config['token'], 'sendMessage', Array('chat_id' => $message['chat_id'], 'text' => $text, 'parse_mode' => 'HTML', 'disable_web_page_preview' => 'true'));
                        }
                    }
                }

Ответы (0 шт):