forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslotDetails.js
More file actions
26 lines (24 loc) · 961 Bytes
/
slotDetails.js
File metadata and controls
26 lines (24 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
class SlotDetails {
/**
* SlotDetails is a small class that defines a "slot" to be filled in a SlotFillingDialog.
* @param {string} name The field name used to store user's response.
* @param {string} promptId A unique identifier of a Dialog or Prompt registered on the DialogSet.
* @param {string} prompt The text of the prompt presented to the user.
* @param {string} reprompt (optional) The text to present if the user responds with an invalid value.
*/
constructor(name, promptId, prompt, reprompt) {
this.name = name;
this.promptId = promptId;
if (prompt && reprompt) {
this.options = {
prompt: prompt,
retryPrompt: reprompt
};
} else {
this.options = prompt;
}
}
}
module.exports.SlotDetails = SlotDetails;