本文整理汇总了TypeScript中botbuilder.UniversalBot.library方法的典型用法代码示例。如果您正苦于以下问题:TypeScript UniversalBot.library方法的具体用法?TypeScript UniversalBot.library怎么用?TypeScript UniversalBot.library使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botbuilder.UniversalBot
的用法示例。
在下文中一共展示了UniversalBot.library方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
var bot = new builder.UniversalBot(connector, (session) => session.replaceDialog("greetings:start", "default"));
// Enable conversation states (storage in azure)
if (enableAzureTableState) {
console.log(`State will be stored in Azure Table Storage. Table Name: ${stateAzureTableName}, Storage Name: ${stateAzureStorageAccountName}`);
let azureTableClient = new storage.AzureTableClient(stateAzureTableName, stateAzureStorageAccountName, stateAzureStorageAccountKey);
let tableStorage = new storage.AzureBotStorage({gzipData: false}, azureTableClient);
bot.set('storage', tableStorage);
}
//=========================================================
// Bot Dialogs Configuration
//=========================================================
// <<< --- ADD YOUR LIBRARIES HERE --- >>>
bot.library(locationDialog.createLibrary(process.env.BING_MAPS_API_KEY));
bot.library(greetings.createLibrary());
bot.library(medication.createLibrary());
bot.library(medicationprompt.createLibrary());
bot.library(countryprompt.createLibrary());
bot.library(places.createLibrary());
bot.library(imagedetection.createLibrary());
// Conversation Update - Send greetings to user when joining the conversation
bot.on('conversationUpdate', (message: IConversationUpdate) => {
if (message.membersAdded) {
message.membersAdded.forEach((identity: IIdentity) => {
if (identity.id !== message.address.bot.id) {
bot.beginDialog(message.address, "greetings:start");
}
});