Telegram Bot custom keyboard in PHP

后端 未结 2 1616
梦如初夏
梦如初夏 2020-12-30 02:19

I\'m trying to make a Telegram Bot in PHP with a custom keyboard. The message is delivered, but the custom keyboard won\'t work. $keyb = array(\'keyboard\' => array(array

2条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 02:53

       $keyboard = array(array("[Destaques]","[Campinas e RMC]","[esportes]"));
       $resp = array("keyboard" => $keyboard,"resize_keyboard" => true,"one_time_keyboard" => true);
       $reply = json_encode($resp);
       $url = $GLOBALS[website]."/sendmessage?chat_id=".$chatId."&text=oi&reply_markup=".$reply;
        file_get_contents($url);
    

    This code works fine!

提交回复
热议问题