Microsoft Bot Framework V4如何获取当前正在执行的对话框集ID

时间:2019-02-27 08:16:15

标签: c# botframework bots

我的问题是在作为瀑布对话框的一部分执行提示时,我需要当前正在执行的提示对话框ID。我的代码如下:

var waterfallSteps = new WaterfallStep[]
{
        CallConfirmAsync,
        SimilarProductAsync,
        SatisfiedPreviouslyAsync,
};
AddDialog(new WaterfallDialog("productenquiry", waterfallSteps));
AddDialog(new ConfirmPrompt("call"));
AddDialog(new ConfirmPrompt("similar"));
AddDialog(new TextPrompt("previous"));

提示对话框的方法是:

private async Task<DialogTurnResult> CallConfirmAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
    return await stepContext.PromptAsync("call", new PromptOptions { Prompt = MessageFactory.Text("Did u make a phone call to user ?") });
}

private async Task<DialogTurnResult> SimilarProductAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
    return await stepContext.PromptAsync("similar", new PromptOptions { Prompt = MessageFactory.Text("similar stuff ?") });
}

private async Task<DialogTurnResult> SatisfiedPreviouslyAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
    // now here, depending on the current dialogid i.e., Similar/call , I need to do 
    // some actions
}

任何人都可以在这里帮助我如何获取当前的提示dialogid以根据条件编写我的代码

0 个答案:

没有答案