2017-01-16 48 views

回答

0

如果找到答案由自己:

用於發送ReplyKeyboardMar KUP通過URL,我們應該用這樣的方式:

https://api.telegram.org/botTOKEN/sendMessage?chat_id=10101010&text= 「TEST」 & reply_markup = { 「鍵盤」:[ 「A」, 「B」]}

,併爲尋找這個網址(或使用代碼發送消息)在php代碼是:

$replyMarkup = array(
    'keyboard' => array(
     array("A", "B") 
    ) 
); 
$encodedMarkup = json_encode($replyMarkup); 
$content = array(
    'chat_id' => "10101010", 
    'reply_markup' => $encodedMarkup, 
    'text' => "Test" 
); 

$newn = json_encode($content); 
$newh = json_decode($newn); 
echo http_build_query($newh)