
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
botbuilder-dialog-loader
Advanced tools
A Library that helps to autload Microsoft Bot Framework dialogs
A Library that helps to autload Microsoft Bot Framework dialogs. Autoloads dialogs from provided folder, able to pass custom arguments for dialogs. It is supposed that every javascript file in the folder will expose only function with bot as first argument. Recommendation**: match dialog id's with the dialog folder structure.
So require('botbuilder-dialog-loader')
will return a function that requires next arguments:
. bot - a UniversalBot instance;
. basePath - a path to dialogs folder;
. config - (optional) a configuration object. Every object's key reflects to
a folder or to a concrete javascript file (without extension). Key's value
should contain or an object (in case of folder) or an array of arguments,
that will be passed to thefile. Example:
{
"folderA" : {
"folderB" : {
"some_dialogs" : [arg1, ..., argN] // A
}
},
"welcome" : ["Hello", "Wolrd!"]
}
/src/dialogs
;/src/dialogs/welcome.js
;welcome.js
:module.exports = function (bot,name) {
bot.dialog('/welcome', [function (session) {
session.send(`My name is - ${name}`)
session.beginDialog('/askForName')
},
function (session, results) {
session.endDialog(`Hi, ${results.response}!`);
setTimeout( function () {
process.exit()
},1000);
}
]);
}
/src/dialogs/askForName.js
;askForName.js
:const botbuilder = require('botbuilder');
module.exports = function (bot) {
bot.dialog('/askForName', [function (session) {
botbuilder.Prompts.text(session, 'What is your name?');
}]);
}
index.js
, a Code:const botbuilder = require('botbuilder');
const path = require('path');
const loader = require('botbuilder-dialog-loader');
let connector = new botbuilder.ConsoleConnector().listen();
let bot = new botbuilder.UniversalBot(connector);
let basePath = path.dirname(__filename) + '/src/dialogs/';
bot.dialog('/', function ( session ) {
session.beginDialog( '/welcome');
})
loader( bot, basePath, {
"welcome" : ["DialogLoader"]
});
console.log('Press any key...');
npm install --save botbuilder-dialog-loader
FAQs
A Library that helps to autload Microsoft Bot Framework dialogs
The npm package botbuilder-dialog-loader receives a total of 3 weekly downloads. As such, botbuilder-dialog-loader popularity was classified as not popular.
We found that botbuilder-dialog-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.