async locationStep(step) {
await step.context.sendActivity('Please give me your location')
const reply = MessageFactory.suggestedActions(['Send location'])
reply.suggestedActions.actions[0].content_type = 'location'
reply.suggestedActions.actions[0].type = 'location'
return step.prompt(LOCATION_PROMPT, reply)
}
我想在 botbuilder v4 中提示位置时添加快速回复 FB Messenger 像这个 ( https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies/#best_practices ) 但它不起作用。有针对这个的解决方法吗?谢谢你帮助我!
最佳答案
在Microsoft Botframework v4 中,可以使用事件中的channelData
属性发送Facebook 位置快速回复。请参见下面的示例。
await turnContext.sendActivity({
text: 'Would you mind sharing your location?',
channelData: {
"quick_replies":[
{
"content_type": "location"
}
]
}
});
希望这对您有所帮助!
关于javascript - botbuilder v4 nodejs 在提示对话框中添加快速回复 facebook messenger,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53700011/