用户按内联按钮后发送图片 - php中的电报机器人

I know how to send photo or file and get callback data and answer it

Now how can I send photo when user press inline button ?

Here is my code

$option = array( 
    array(
        $telegram->buildInlineKeyboardButton($text="One","",$callback_data="One",""),
        $telegram->buildInlineKeyboardButton($text="Two","",$callback_data="Two","")
    )
);

$keyb = $telegram->buildInlineKeyBoard($option);

$content = array(
    'chat_id' => $chat_id,
    'reply_markup' => $keyb,
    'text' => "One Or Two ?"
);

$telegram->sendMessage($content);

Appreciate for any answer

you should set an query callback handler . the call back has the data of button call back (which you set , not caption);

you must swich case between call back string to handle what happen ,

and then send photo by api.