forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
21 lines (18 loc) · 700 Bytes
/
bot.js
File metadata and controls
21 lines (18 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const { ActivityTypes } = require('botbuilder');
class MyBot {
/**
*
* @param {TurnContext} on turn context object.
*/
async onTurn(turnContext) {
// See https://aka.ms/about-bot-activity-message to learn more about the message and other activity types.
if (turnContext.activity.type === ActivityTypes.Message) {
await turnContext.sendActivity(`You said '${ turnContext.activity.text }'`);
} else {
await turnContext.sendActivity(`[${ turnContext.activity.type } event detected]`);
}
}
}
module.exports.MyBot = MyBot;