我目前有一个Bot Dialog,要求并接收用户的附件。我想将其转换为表格对话框,因为我认为这更适合(“请发送给我文件1”......直到文件N)。你能指点一个表格对话的例子来接收用户的附件吗?
我读到FormFlow现在有附件支持: https://github.com/Microsoft/BotBuilder/pull/2870/commits/55c3d336a6cd63ee96561eeed9a905fb8c156a87#diff-db1cd0aff903bd4f06fadb81b6f33d86
除了以外我找不到任何例子: https://github.com/southworkscom/BotBuilder/blob/55c3d336a6cd63ee96561eeed9a905fb8c156a87/CSharp/Samples/Microsoft.Bot.Sample.FormFlowAttachmentsBot/ImagesForm.cs这个使用AwaitableAttachment对象。我无法弄清楚它来自哪里......
理想情况下,我希望从用户那里收到一个List,就像用户如何发送多个附件一样,我在正常的对话框中,我可以使用messages.Attachments
检索它。列表不起作用,普通的附件对象类型也不起作用:
[Prompt("Send me a copy of your **Document 1**.")]
public Attachment Doc1;
[Prompt("Send me a copy of your **Document 2**.")]
public Attachment Doc2;
...
private static IForm<MyForm> BuildMyForm()
{
OnCompletionAsyncDelegate<MyForm> completeForm = async (context, state) =>
{
//await context.PostAsync($"Completed.");
};
var form = CreateCustomForm<MyForm>()
.Message("Let's start!")
.Field(nameof(Doc1))
.Field(nameof(Doc2))
...
.OnCompletion(completeForm)
.Build();
return (IForm<MyForm>)form;
}