ActivityPrompt 类
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. ActivityPrompt
- com.
- com.
public class ActivityPrompt
extends Dialog
定义等待接收活动的提示对话的核心行为。 此提示要求传入验证程序,在等待接收事件等非消息活动时非常有用。验证程序可以忽略接收的活动,直到收到预期的活动类型。
构造函数摘要
构造函数 | 说明 |
---|---|
ActivityPrompt(String dialogId, PromptValidator<Activity> validator) |
初始化 ActivityPrompt 类的新实例。 |
方法摘要
方法继承自 Dialog
方法继承自 java.lang.Object
构造函数详细信息
ActivityPrompt
public ActivityPrompt(String dialogId, PromptValidator
初始化 ActivityPrompt 类的新实例。 从派生类中的构造函数中调用,用于初始化 ActivityPrompt 类。
Parameters:
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="DialogSet"></xref> or <xref uid="com.microsoft.bot.dialogs.ComponentDialog" data-throw-if-not-resolved="false" data-raw-source="ComponentDialog"></xref> to which the
prompt is added.
方法详细信息
beginDialog
public CompletableFuture
在将提示对话推送到对话堆栈并激活时调用。
Overrides:
ActivityPrompt.beginDialog(DialogContext dc, Object options)Parameters:
Returns:
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
当提示对话为活动对话且用户使用新活动进行答复时调用。
Overrides:
ActivityPrompt.continueDialog(DialogContext dc)Parameters:
Returns:
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.
onPrompt
protected CompletableFuture
在派生类中重写时,提示用户输入。
Parameters:
Returns:
onPrompt
protected CompletableFuture
在派生类中重写时,提示用户输入。
Parameters:
Returns:
onRecognize
protected CompletableFuture<>
在派生类中重写时,尝试识别传入的活动。
Parameters:
Returns:
If the task is successful, the result describes the result of the
recognition attempt.
repromptDialog
public CompletableFuture
在请求提示对话框以重新提示用户输入时调用。
Overrides:
ActivityPrompt.repromptDialog(TurnContext turnContext, DialogInstance instance)Parameters:
Returns:
resumeDialog
public CompletableFuture
当提示对话恢复为对话堆栈上的活动对话时调用,例如当堆栈上的上一个活动对话完成时调用。
Overrides:
ActivityPrompt.resumeDialog(DialogContext dc, DialogReason reason, Object result)Parameters:
Returns:
If the task is successful, the result indicates whether the dialog is
still active after the turn has been processed by the dialog.