ActivityPrompt 類別
- java.
lang. Object - com.
microsoft. bot. dialogs. Dialog - com.
microsoft. bot. dialogs. prompts. ActivityPrompt
- com.
- com.
public class ActivityPrompt
extends Dialog
定義提示對話框的核心行為,該對話框會等候接收活動。 此提示需要傳入驗證程式,而且在等候非訊息活動時很有用,例如要接收的事件。驗證程式可以忽略接收的活動,直到收到預期的活動類型為止。
建構函式摘要
| 建構函式 | Description |
|---|---|
| ActivityPrompt(String dialogId, PromptValidator<Activity> validator) |
初始化 ActivityPrompt 類別的新實例。 |
方法摘要
| 修飾詞與類型 | 方法與描述 |
|---|---|
|
java.util.concurrent.CompletableFuture<Dialog |
beginDialog(DialogContext dc, Object options)
當提示對話框推送至對話堆疊並正在啟動時呼叫。 |
|
java.util.concurrent.CompletableFuture<Dialog |
continueDialog(DialogContext dc)
當提示對話框是作用中的對話框,且使用者以新的活動回復時呼叫。 |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
在衍生類別中覆寫時,提示用戶輸入。 |
| protected java.util.concurrent.CompletableFuture<java.lang.Void> |
onPrompt(TurnContext turnContext, Map<String,Object> state, PromptOptions options, Boolean isRetry)
在衍生類別中覆寫時,提示用戶輸入。 |
|
protected
java.util.concurrent.CompletableFuture<Prompt |
onRecognize(TurnContext turnContext, Map<String,Object> state, PromptOptions options)
在衍生類別中覆寫時,會嘗試辨識傳入的活動。 |
| java.util.concurrent.CompletableFuture<java.lang.Void> |
repromptDialog(TurnContext turnContext, DialogInstance instance)
當要求提示對話方塊重新提示使用者輸入時呼叫。 |
|
java.util.concurrent.CompletableFuture<Dialog |
resumeDialog(DialogContext dc, DialogReason reason, Object result)
當提示對話框繼續成為對話堆疊上的使用中對話框時呼叫,例如當堆棧上的上一個使用中對話方塊完成時。 |
方法繼承來源 Dialog
方法繼承來源 java.lang.Object
建構函式詳細資料
ActivityPrompt
public ActivityPrompt(String dialogId, PromptValidator
初始化 ActivityPrompt 類別的新實例。 從衍生類別中的建構函式呼叫,以初始化 ActivityPrompt 類別。
參數:
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
當提示對話框推送至對話堆疊並正在啟動時呼叫。
覆寫:
ActivityPrompt.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
當提示對話框是作用中的對話框,且使用者以新的活動回復時呼叫。
覆寫:
ActivityPrompt.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.
onPrompt
protected CompletableFuture
在衍生類別中覆寫時,提示用戶輸入。
參數:
傳回:
onPrompt
protected CompletableFuture
在衍生類別中覆寫時,提示用戶輸入。
參數:
傳回:
onRecognize
protected CompletableFuture
在衍生類別中覆寫時,會嘗試辨識傳入的活動。
參數:
傳回:
If the task is successful, the result describes the result of the
recognition attempt.
repromptDialog
public CompletableFuture
當要求提示對話方塊重新提示使用者輸入時呼叫。
覆寫:
ActivityPrompt.repromptDialog(TurnContext turnContext, DialogInstance instance)參數:
傳回:
resumeDialog
public CompletableFuture
當提示對話框繼續成為對話堆疊上的使用中對話框時呼叫,例如當堆棧上的上一個使用中對話方塊完成時。
覆寫:
ActivityPrompt.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.