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
定義提示對話框的核心行為。 當提示結束時,它應該會傳回 Object,代表提示的值。 使用 add(Dialog dialog) 或 addDialog(Dialog dialog),分別將提示新增至對話框集或元件對話方塊。 使用 prompt(String dialogId, PromptOptions options) 或 beginDialog(String dialogId, Object options) 啟動提示。 如果您從 WaterfallDialog中的 WaterfallStep 啟動提示,則瀑布的下一個步驟中將會提供提示結果。
欄位摘要
| 修飾詞與類型 | 欄位與描述 |
|---|---|
| static final java.lang.String | ATTEMPTCOUNTKEY |
建構函式摘要
| 建構函式 | Description |
|---|---|
| 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.