Prompt<T> 类
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. Prompt<T>
- com.
- com.
类型参数
- T
键入要为其创建的提示。
public abstract class Prompt
extends Dialog
定义提示对话的核心行为。 提示结束时,它应返回一个对象,该对象表示提示的值。 使用 add(Dialog dialog) 或 addDialog(Dialog dialog) 分别向对话框集或组件对话添加提示。 使用 prompt(String dialogId, PromptOptions options) 或 beginDialog(String dialogId, Object options) 启动提示。 如果在 WaterfallDialog中从 WaterfallStep 启动提示,则瀑布的下一步中将提供提示结果。
字段摘要
| 修饰符和类型 | 字段和描述 |
|---|---|
| static final java.lang.String | ATTEMPTCOUNTKEY |
构造函数摘要
| 构造函数 | 说明 |
|---|---|
| Prompt(String dialogId, PromptValidator<T> validator) |
初始化 {@link Prompt{T}} 类的新实例。 |
方法摘要
方法继承自 Dialog
方法继承自 java.lang.Object
字段详细信息
ATTEMPTCOUNTKEY
public static final String ATTEMPTCOUNTKEY
构造函数详细信息
Prompt
public Prompt(String dialogId, PromptValidator
初始化 {@link Prompt{T}} 类的新实例。 从派生类中的构造函数调用以初始化 {@link Prompt{T}} 类。
参数:
The value of dialogId must be unique within the
<xref uid="com.microsoft.bot.dialogs.DialogSet" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.bot.dialogs.DialogSet"></xref> or
<xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.bot.dialogs.ComponentDialog"></xref> to which
the prompt is added.
方法详细信息
appendChoices
protected Activity appendChoices(Activity prompt, String channelId, List
在派生类中重写时,在系统提示用户输入时,将选项追加到活动。
参数:
返回:
If the task is successful, the result contains the updated activity.
beginDialog
public CompletableFuture
当将提示对话推送到对话堆栈并正在激活时调用。
替代:
Prompt<T>.beginDialog(DialogContext dc, Object options)参数:
返回:
If the task is successful, the result indicates whether the prompt is
still active after the turn has been processed by the prompt.
continueDialog
public CompletableFuture
当提示对话框是活动对话框,用户用新活动答复时调用。
替代:
Prompt<T>.continueDialog(DialogContext dc)参数:
返回:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog. The
prompt generally continues to receive the user's replies until it
accepts the user's reply as valid input for the prompt.
onPreBubbleEvent
protected CompletableFuture
在将事件气泡到其父级之前调用。 这是执行事件截获的好位置,因为返回“true”将阻止事件进一步浮升到对话父级,并且还会阻止任何子对话执行其默认处理。
替代:
Prompt<T>.onPreBubbleEvent(DialogContext dc, DialogEvent e)参数:
返回:
onPrompt
protected abstract CompletableFuture
在派生类中重写时,提示用户输入。
参数:
返回:
onRecognize
protected abstract CompletableFuture
在派生类中重写时,尝试识别用户的输入。
参数:
返回:
If the task is successful, the result describes the result of the
recognition attempt.
repromptDialog
public CompletableFuture
当请求提示对话框重新提示用户输入时调用。
替代:
Prompt<T>.repromptDialog(TurnContext turnContext, DialogInstance instance)参数:
返回:
resumeDialog
public CompletableFuture
当提示对话框恢复为对话堆栈上的活动对话时调用,例如堆栈上以前的活动对话完成时。
替代:
Prompt<T>.resumeDialog(DialogContext dc, DialogReason reason, Object result)参数:
返回:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog.