Как запустить еще одно диалоговое окно с водопадом после запуска модуля задачи? (NodeJS) - PullRequest
0 голосов
/ 05 марта 2020

Код для бота

const { DialogSet } = require("botbuilder-dialogs");

const { BaseBot } = require("./basebot");

const { ScheduleDialog } = require("../dialogs/session/schedule-dialog");

class Bot extends BaseBot {
  constructor(conversationState, userState, dialog) {
    super(conversationState, userState, dialog);

    this.scheduleDialog = new ScheduleDialog();

    this.onMembersAdded(async (context, next) => {
      const membersAdded = context.activity.membersAdded;
      for (let cnt = 0; cnt < membersAdded.length; cnt++) {
        if (membersAdded[cnt].id !== context.activity.recipient.id) {
          await context.sendActivity("Hi, Welcome to Bot");
        }
      }

      await next();
    });
  }

  async handleTeamsSigninVerifyState(context, state) {
    await this.dialog.run(context, this.dialogState);
  }

  async handleTeamsTaskModuleSubmit(context, taskModuleRequest) {
      await this.scheduleDialog.run(context, this.dialogState);
    }
  }
}

module.exports.Bot = Bot;

ScheduleDialog реализует диалог водопада с 3 шагами. Когда я нажимаю кнопку отправки в модуле задач, я могу получить ответ в боте с первого шага. Но когда элемент управления переходит к следующему шагу, я получаю следующую ошибку:

onTurnError] unhandled error: Error: DialogContext.continueDialog(): Can't continue dialog. A dialog with an id of 'ScheduleDialog' wasn't found.
...