This repository was archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathRootDialog.ts
More file actions
121 lines (110 loc) · 5.61 KB
/
RootDialog.ts
File metadata and controls
121 lines (110 loc) · 5.61 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import * as builder from "botbuilder";
import { Strings } from "../locale/locale";
import { DialogIds } from "../utils/DialogIds";
// let config = require("config");
// *************************** BEGINNING OF EXAMPLES ***************************
import { ResetUserStateDialog } from "./examples/auth/ResetUserStateDialog";
import { VSTSAPICallDialog } from "./examples/auth/VSTSAPICallDialog";
import { VSTSAuthValidateUserDialog } from "./examples/auth/VSTSAuthValidateUserDialog";
import { VSTSLogInDialog } from "./examples/auth/VSTSLogInDialog";
import { GetLastDialogUsedDialog } from "./examples/basic/GetLastDialogUsedDialog";
import { HelloDialog } from "./examples/basic/HelloDialog";
import { HelpDialog } from "./examples/basic/HelpDialog";
import { HeroCardDialog } from "./examples/basic/HeroCardDialog";
import { MessageBackReceiverDialog } from "./examples/basic/MessageBackReceiverDialog";
import { MultiDialog } from "./examples/basic/MultiDialog";
import { O365ConnectorCardActionsDialog } from "./examples/basic/O365ConnectorCardActionsDialog";
import { O365ConnectorCardDialog } from "./examples/basic/O365ConnectorCardDialog";
import { ThumbnailCardDialog } from "./examples/basic/ThumbnailCardDialog";
import { TimezoneDialog } from "./examples/basic/TimezoneDialog";
import { BeginDialogFlowDialog } from "./examples/moderate/BeginDialogFlowDialog";
import { ConstructorArgsDialog } from "./examples/moderate/ConstructorArgsDialog";
import { ListNamesDialog } from "./examples/moderate/ListNamesDialog";
import { LuisRecognizerNatLanguageDialog } from "./examples/moderate/LuisRecognizerNatLanguageDialog";
import { PromptDialog } from "./examples/moderate/PromptDialog";
import { QuizFullDialog } from "./examples/moderate/QuizFullDialog";
import { QuizQ1Dialog } from "./examples/moderate/QuizQ1Dialog";
import { QuizQ2Dialog } from "./examples/moderate/QuizQ2Dialog";
import { QuizQ3Dialog } from "./examples/moderate/QuizQ3Dialog";
import { AtMentionDialog } from "./examples/teams/AtMentionDialog";
import { ChannelDataDialog } from "./examples/teams/ChannelDataDialog";
import { DeeplinkDialog } from "./examples/teams/DeeplinkDialog";
import { FetchRosterDialog } from "./examples/teams/FetchRosterDialog";
import { FetchTeamInfoDialog } from "./examples/teams/FetchTeamInfoDialog";
import { ProactiveMsgTo1to1Dialog } from "./examples/teams/ProactiveMsgTo1to1Dialog";
import { ProactiveMsgToChannelDialog } from "./examples/teams/ProactiveMsgToChannelDialog";
import { UpdateCardMsgDialog } from "./examples/teams/UpdateCardMsgDialog";
import { UpdateCardMsgSetupDialog } from "./examples/teams/UpdateCardMsgSetupDialog";
import { UpdateTextMsgDialog } from "./examples/teams/UpdateTextMsgDialog";
import { UpdateTextMsgSetupDialog } from "./examples/teams/UpdateTextMsgSetupDialog";
import { NotifyDialog } from "./examples/teams/NotifyDialog";
import { PopupSignInDialog } from "./examples/basic/PopupSignInDialog";
import { AdaptiveCardDialog } from "./examples/basic/AdaptiveCardDialog";
import { ListCardDialog } from "./examples/basic/ListCardDialog";
// *************************** END OF EXAMPLES *********************************
// Add imports for dialogs
// Main dialog that handles commands
export class RootDialog extends builder.IntentDialog {
constructor(
private bot: builder.UniversalBot,
) {
super();
this.onDefault((session) => { this._onDefault(session); });
bot.dialog(DialogIds.RootDialogId, this);
// Add LUIS recognizer for natural language processing
// let luisEndpoint = config.get("luis.endpointUri");
// if (luisEndpoint) {
// bot.recognizer(new builder.LuisRecognizer(luisEndpoint));
// }
}
// Create the child dialogs and attach them to the bot
public createChildDialogs(): void {
let bot = this.bot;
// *************************** BEGINNING OF EXAMPLES ***************************
new ResetUserStateDialog(bot);
new VSTSAPICallDialog(bot);
new VSTSAuthValidateUserDialog(bot);
new VSTSLogInDialog(bot);
new GetLastDialogUsedDialog(bot);
new HelloDialog(bot);
new HelpDialog(bot);
new HeroCardDialog(bot);
new MessageBackReceiverDialog(bot);
new MultiDialog(bot);
new O365ConnectorCardActionsDialog(bot);
new O365ConnectorCardDialog(bot);
new ThumbnailCardDialog(bot);
new TimezoneDialog(bot);
new BeginDialogFlowDialog(bot);
new ConstructorArgsDialog(bot, "12345");
new ListNamesDialog(bot);
new LuisRecognizerNatLanguageDialog(bot);
new PromptDialog(bot);
new QuizFullDialog(bot);
new QuizQ1Dialog(bot);
new QuizQ2Dialog(bot);
new QuizQ3Dialog(bot);
new AtMentionDialog(bot);
new ChannelDataDialog(bot);
new DeeplinkDialog(bot);
new FetchRosterDialog(bot);
new FetchTeamInfoDialog(bot);
new ProactiveMsgTo1to1Dialog(bot);
new ProactiveMsgToChannelDialog(bot);
new UpdateCardMsgDialog(bot);
new UpdateCardMsgSetupDialog(bot);
new UpdateTextMsgDialog(bot);
new UpdateTextMsgSetupDialog(bot);
new NotifyDialog(bot);
new PopupSignInDialog(bot);
new AdaptiveCardDialog(bot);
new ListCardDialog(bot);
// *************************** END OF EXAMPLES *********************************
// Add child dialogs
}
// Handle unrecognized input
private _onDefault(session: builder.Session): void {
session.conversationData.currentDialogName = DialogIds.RootDialogId;
session.send(Strings.root_dialog_on_default);
}
}