Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(userState, conversationState) {
super(MAIN_DIALOG);
this.userState = userState;
this.conversationState = conversationState;
this.userProfileAccessor = userState.createProperty(USER_PROFILE_PROPERTY);
this.conversationStateAccessor = userState.createProperty(CONVERSATION_STATE_ACCESSOR);
// Create a dialog set for the bot. It requires a DialogState accessor, with which
// to retrieve the dialog state from the turn context.
this.addDialog(new ChoicePrompt(INITIAL_PROMPT, this.validateNumberOfAttempts.bind(this)));
this.addDialog(new TextPrompt(INITIAL_HOTEL_PROMPT));
this.addDialog(new DateTimePrompt(CHECKIN_DATETIME_PROMPT));
this.addDialog(new TextPrompt(HOW_MANY_NIGHTS_PROMPT));
this.addDialog(new FlightDialog(FLIGHTS_DIALOG));
// Define the steps of the base waterfall dialog and add it to the set.
this.addDialog(new WaterfallDialog(BASE_DIALOG, [
this.promptForBaseChoice.bind(this),
this.respondToBaseChoice.bind(this),
]));
// Define the steps of the hotels waterfall dialog and add it to the set.
this.addDialog(new HotelsDialog(HOTELS_DIALOG));
this.initialDialogId = BASE_DIALOG;
}
constructor(conversationState) {
// Creates our state accessor properties.
// See https://aka.ms/about-bot-state-accessors to learn more about the bot state and state accessors.
this.dialogStateAccessor = conversationState.createProperty(DIALOG_STATE_ACCESSOR);
this.reservationAccessor = conversationState.createProperty(RESERVATION_ACCESSOR);
this.conversationState = conversationState;
// Create the dialog set and add the prompts, including custom validation.
this.dialogSet = new DialogSet(this.dialogStateAccessor);
this.dialogSet.add(new NumberPrompt(SIZE_RANGE_PROMPT, this.rangeValidator));
this.dialogSet.add(new ChoicePrompt(LOCATION_PROMPT));
this.dialogSet.add(new DateTimePrompt(RESERVATION_DATE_PROMPT, this.dateValidator));
// Define the steps of the waterfall dialog and add it to the set.
this.dialogSet.add(new WaterfallDialog(RESERVATION_DIALOG, [
this.promptForPartySize.bind(this),
this.promptForLocation.bind(this),
this.promptForReservationDate.bind(this),
this.acknowledgeReservation.bind(this),
]));
}
constructor(id) {
super(id || 'dateResolverDialog');
this.addDialog(new DateTimePrompt(DATETIME_PROMPT, this.dateTimePromptValidator.bind(this)))
.addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
this.initialStep.bind(this),
this.finalStep.bind(this)
]));
this.initialDialogId = WATERFALL_DIALOG;
}
constructor(id: string) {
super(id || 'dateResolverDialog');
this.addDialog(new DateTimePrompt(DATETIME_PROMPT, DateResolverDialog.dateTimePromptValidator.bind(this)))
.addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
this.initialStep.bind(this),
this.finalStep.bind(this),
]));
this.initialDialogId = WATERFALL_DIALOG;
}
constructor(id: string) {
super(id || 'dateResolverDialog');
this.addDialog(new DateTimePrompt(DATETIME_PROMPT, DateResolverDialog.dateTimePromptValidator.bind(this)))
.addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
this.initialStep.bind(this),
this.finalStep.bind(this)
]));
this.initialDialogId = WATERFALL_DIALOG;
}
constructor(id: string) {
super(id || 'dateResolverDialog');
this.addDialog(new DateTimePrompt(DATETIME_PROMPT, DateResolverDialog.dateTimePromptValidator.bind(this)))
.addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
this.initialStep.bind(this),
this.finalStep.bind(this)
]));
this.initialDialogId = WATERFALL_DIALOG;
}
constructor(id) {
super(id || 'dateResolverDialog');
this.addDialog(new DateTimePrompt(DATETIME_PROMPT, this.dateTimePromptValidator.bind(this)))
.addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
this.initialStep.bind(this),
this.finalStep.bind(this)
]));
this.initialDialogId = WATERFALL_DIALOG;
}
constructor(id) {
super(id || 'dateResolverDialog');
this.addDialog(new DateTimePrompt(DATETIME_PROMPT, this.dateTimePromptValidator.bind(this)))
.addDialog(new WaterfallDialog(WATERFALL_DIALOG, [
this.initialStep.bind(this),
this.finalStep.bind(this)
]));
this.initialDialogId = WATERFALL_DIALOG;
}