2017-01-06 49 views
0

即時通訊開發一個聊天機器人的信使臉譜,我已經有問候文本,一個菜單(還沒有工作),和一個開始按鈕,當我嘗試測試,以recive通用模板,它根本沒有什麼,如果我改變了答覆,一個簡單的文本,它的反應,文本,但通用模板不是,我從這裏複製示例:https://developers.facebook.com/docs/messenger-platform/thread-settings不能發送通用模板從Messenger的API(Facebook)

我不知道爲什麼不能獲得通用模板,如果我配置爲響應與圖像,按鈕,文本,所有這一切,但模板不,這是我如何配置的諧振:

$response = '{ 
    "recipient":{ 
    "id":"'.$senderId.'" 
    }, 
    "message":{ 
    "attachment":{ 
     "type":"template", 
     "payload":{ 
     "template_type":"generic", 
     "elements":[ 
      { 
      "title":"Sin saber, vivió casi un mes entre muertos", 
      "image_url":"https://diario.mx/imagesnotas/2017/01/LOC1307270af08088b_0.jpg", 
      "subtitle":"Desde el lunes empezó a hacer oración para el descanso de las almas torturadas y sepultadas, afirma", 
      "default_action": { 
       "type": "web_url", 
       "url": "https://diario.mx/Local/2017-01-05_f62a689b/sin-saber-vivio-casi-un-mes-entre-muertos/", 
       "messenger_extensions": true, 
       "webview_height_ratio": "tall", 
       "fallback_url": "https://diario.mx/" 
      } , 
      "buttons":[ 
       { 
       "type":"web_url", 
       "url":"https://diario.mx/", 
       "title":"Ir a diario.mx" 
       },{ 
       "type":"postback", 
       "title":"Start Chatting", 
       "payload":"DEVELOPER_DEFINED_PAYLOAD" 
       }    
      ]  
      } 
     ] 
     } 
    } 
    } 
}'; 

被來自quick_replies選項的自定義有效載荷「masleidas」觸發

回答

0

根據文檔,副標題的字符數限制爲80,而您的示例在副標題中顯示99個字符。所以我覺得這個角色太多了。

你從FB API返回的任何錯誤到你的chatbot?

相關問題