我是僵尸开发的新手。我正在和facebook Messan一起玩wit.ai。我们如何设置quick replies
的{{1}}?
答案 0 :(得分:0)
我是这样做的:
if quick_replies:
data['message']['quick_replies'] =[{'content_type': 'text', 'title': qr, 'payload': 'n/a'} for qr in quick_replies]
requests.post(FB_URL % 'me/messages', json=data, headers={'Content-Type': 'application/json'}).json()
我从Wit.ai获取quick_replies
列表,当它调用我的发送操作时。例如:
def send(request, response):
fb.send_message(request['session_id'][32:], response['text'], response['quickreplies'] if ('quickreplies' in response) else None)
return request['context']