在瀑布步骤期间未定义dialogContext.activeDialog

时间:2019-04-03 18:02:03

标签: botframework azure-bot-service

我正在尝试使用以下oAuth提示对用户进行身份验证:

var str = "Stark, Arya C.";

var i = str.indexOf(",")+1;
str = str.slice(0, i).toUpperCase() + str.slice(i);

console.log(str);

然后我创建瀑布步骤:

private oauthPrompt = new OAuthPrompt("sign-in", {
    connectionName: this.oauthSigninAzureId,
    title: "Login"
});

然后我运行它:

 private waterfall = new WaterfallDialog(INTENTS.GREETING, [
        (step: WaterfallStepContext) => {
            return step.prompt(
                INTENTS.SIGN_IN,
                " Hello and welcome."
            )
        }, async (step: WaterfallStepContext) => {
            const token = step.result.token;
            ...
        },
    ]);

第一步运行良好。但是,当尝试查看是否有活动对话框时,我检查const dialogContext = await this.dialogs.createContext(context); // activeDialog is ALWAYS empty if (!dialogContext.activeDialog) await dialogContext.beginDialog("sign-in"); else dialogContext.continueDialog(); 只是发现它是未定义的。

0 个答案:

没有答案