Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected async onPrompt(context: TurnContext, state: any, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
protected async onPrompt(context: TurnContext, state: any, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async beginDialog(dc: DialogContext, options: PromptOptions): Promise {
// Ensure prompts have input hint set
const opt: Partial = {...options};
if (opt.prompt && typeof opt.prompt === 'object' && typeof opt.prompt.inputHint !== 'string') {
opt.prompt.inputHint = InputHints.ExpectingInput;
}
if (opt.retryPrompt && typeof opt.retryPrompt === 'object' && typeof opt.retryPrompt.inputHint !== 'string') {
opt.retryPrompt.inputHint = InputHints.ExpectingInput;
}
// Initialize prompt state
const state: any = dc.activeDialog.state as ActivityPromptState;
state.options = opt;
state.state = {};
// Send initial prompt
await this.onPrompt(dc.context, state.state, state.options, false);
return Dialog.EndOfTurn;
}
protected async onPrompt(context: TurnContext, state: any, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
protected async onPrompt(context: TurnContext, state: any, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
protected async onPrompt(context: TurnContext, state: object, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
protected async onPrompt(context: TurnContext, state: any, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
protected async onPrompt(context: TurnContext, state: object, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}
protected async onPrompt(context: TurnContext, state: any, options: PromptOptions, isRetry: boolean): Promise {
if (isRetry && options.retryPrompt) {
await context.sendActivity(options.retryPrompt, undefined, InputHints.ExpectingInput);
} else if (options.prompt) {
await context.sendActivity(options.prompt, undefined, InputHints.ExpectingInput);
}
}