Skip to content

Instantly share code, notes, and snippets.

@JonJam
Last active January 11, 2018 08:20
Show Gist options
  • Select an option

  • Save JonJam/9a878d9dfdc7aa22bd81dfe9bea2baf3 to your computer and use it in GitHub Desktop.

Select an option

Save JonJam/9a878d9dfdc7aa22bd81dfe9bea2baf3 to your computer and use it in GitHub Desktop.
Using libraries
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;
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