我想模拟在瀑布对话框中输入。我已经尝试了下面的代码,但它不起作用(有延迟,毕竟是文本)。怎么做(如果可能的话)?
private async Task<DialogTurnResult> ConfidentialityStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
await stepContext.Context.SendActivityAsync(MessageFactory.Text("Confidentiality is very important for me"), cancellationToken);
await stepContext.Context.SendActivityAsync(MessageFactory.Text("All your data are completely safe"), cancellationToken);
var confidentiality = stepContext.Context.Activity.CreateReply();
var url = new HeroCard
{
Text = "Terms of use",
Buttons = new List<CardAction> { new CardAction(ActionTypes.OpenUrl, "More informations", value: "") },
};
confidentiality.Attachments = new List<Attachment>() { url.ToAttachment() };
await stepContext.Context.SendActivityAsync(confidentiality, cancellationToken);
return await stepContext.NextAsync(cancellationToken: cancellationToken);
}
private async Task<DialogTurnResult> TermsStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
await stepContext.Context.SendActivitiesAsync(
new Activity[] {
new Activity { Type = ActivityTypes.Typing },
new Activity { Type = "delay", Value= 2000 },
MessageFactory.Text("XXXXXXXXx"),
}, cancellationToken);
return await stepContext.NextAsync(cancellationToken: cancellationToken);
}