/
app.js
executable file
·40 lines (35 loc) · 1.16 KB
/
app.js
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
// bot setup
require('./connectorSetup.js')();
// dialogs
require('./dialogs/greeting.js')();
require('./dialogs/ask.js')();
require('./dialogs/timetable.js')();
require('./dialogs/welcome.js')();
require('./dialogs/help.js')();
require('./dialogs/restart.js')();
// root dialog
bot.dialog('rootDialog',
function (session) {
session.beginDialog('greetingDialog');
},
intents
).beginDialogAction('help', 'helpDialog', { matches: 'Help'});
bot.dialog('defaultDialog', function (session) {
session.send("I'm sorry, I didn't understand that.");
}).triggerAction({
matches: 'None'
});
// first time use
// bot.on('conversationUpdate', function (message, session) {
// if (message.membersAdded) {
// message.membersAdded.forEach(function (identity) {
// if (identity.id === message.address.bot.id) {
// var reply = new builder.Message()
// .address(message.address)
// .text("Hey! I\'m the NUSTalkBot. Type start to see the welcome message.");
// bot.send(reply);
// session.replaceDialog('rootDialog');
// }
// });
// }
// });