我如何让聊天机器人将任何文件夹中的附件发送给用户?
我有下面的代码,但他不起作用,他什么都没显示。
你能帮我吗?
const { TextPrompt,AttachmentPrompt } = require('botbuilder-dialogs');
constructor(luisRecognizer,bookingDialog) {
super('MainDialog');
this.addDialog(new TextPrompt('TextPrompt'))
.addDialog(new AttachmentPrompt('AttachmentPrompt'))
.addDialog(bookingDialog)
.addDialog(new WaterfallDialog(MAIN_WATERFALL_DIALOG,[
this.introStep.bind(this),this.sendAttachmentStep.bind(this),this.finalStep.bind(this)
]));
}
async sendAttachmentStep(stepContext) {
var base64Name = "Book1.xlsx";
var base64Type = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
var base64Url = "http://localhost:49811/v3/attachments/.../views/original";
var att = await stepContext.prompt('AttachmentPrompt',{
name: base64Name,contentType: base64Type,contentUrl: base64Url,});
var nex = await stepContext.next();
return {
att,nex
}
}