Last active
January 11, 2018 08:20
-
-
Save JonJam/9a878d9dfdc7aa22bd81dfe9bea2baf3 to your computer and use it in GitHub Desktop.
Using libraries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Library, Session } from "botbuilder"; | |
| import strings from "../../strings"; | |
| const lib = new Library("global"); | |
| lib | |
| .dialog("help", (session: Session) => { | |
| session.endDialog(strings.global.help.message); | |
| }) | |
| .triggerAction({ | |
| // LUIS intent | |
| matches: "global:help" | |
| }); | |
| export default lib; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ChatConnector, UniversalBot } from "botbuilder"; | |
| import { appId, appPassword } from "../settings"; | |
| import defaultDialog from "./dialogs/default"; | |
| import global from "./dialogs/global"; | |
| // Create chat connector for communicating with the Bot Framework Service | |
| const connector = new ChatConnector({ | |
| appId, | |
| appPassword | |
| }); | |
| const bot = new UniversalBot(connector, defaultDialog); | |
| bot.library(global.clone()); | |
| export default connector; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment