Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

botbuilder

Package Overview
Dependencies
Maintainers
1
Versions
631
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botbuilder - npm Package Compare versions

Comparing version 3.5.0-rc6 to 3.5.0-rc7

lib/cards/AnimationCard.js

10

lib/botbuilder.js

@@ -20,2 +20,7 @@ "use strict";

var ThumbnailCard = require('./cards/ThumbnailCard');
var VideoCard = require('./cards/VideoCard');
var AudioCard = require('./cards/AudioCard');
var AnimationCard = require('./cards/AnimationCard');
var MediaCard = require('./cards/MediaCard');
var CardMedia = require('./cards/CardMedia');
var Keyboard = require('./cards/Keyboard');

@@ -33,2 +38,7 @@ var Middleware = require('./middleware/Middleware');

exports.HeroCard = HeroCard.HeroCard;
exports.VideoCard = VideoCard.VideoCard;
exports.AudioCard = AudioCard.AudioCard;
exports.AnimationCard = AnimationCard.AnimationCard;
exports.MediaCard = MediaCard.MediaCard;
exports.CardMedia = CardMedia.CardMedia;
exports.CardImage = CardImage.CardImage;

@@ -35,0 +45,0 @@ exports.ReceiptCard = ReceiptCard.ReceiptCard;

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Bot Builder is a dialog system for building rich bots on virtually any platform.",
"version": "3.5.0-rc6",
"version": "3.5.0-rc7",
"license": "MIT",

@@ -8,0 +8,0 @@ "keywords": [

@@ -60,3 +60,4 @@ var assert = require('assert');

var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session, args) {
bot.dialog('/', function (session) {
session.send('Hi');
}).triggerAction({

@@ -73,2 +74,113 @@ matches: /test/i,

});
it('should reload the same dialog using a reloadAction().', function (done) {
var menuLoaded = false;
var connector = new builder.ConsoleConnector();
var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session) {
session.beginDialog('/menu');
});
bot.dialog('/menu', function (session, args) {
builder.Prompts.text(session, "ChooseOption");
}).reloadAction('showMenu', null, { matches: /show menu/i });
bot.on('send', function (message) {
switch (message.text) {
case 'ChooseOption':
if (!menuLoaded) {
menuLoaded = true;
connector.processMessage("show menu");
} else {
done();
}
break;
default:
assert(false);
break;
}
});
connector.processMessage('test');
});
it('should reload the same dialog using a reloadAction() but pass additional args.', function (done) {
var connector = new builder.ConsoleConnector();
var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session) {
session.beginDialog('/menu');
});
bot.dialog('/menu', function (session, args) {
if (args && args.reloaded) {
builder.Prompts.text(session, "ReloadedChooseOption");
} else {
builder.Prompts.text(session, "ChooseOption");
}
}).reloadAction('showMenu', null, {
matches: /show menu/i,
dialogArgs: { reloaded: true }
});
bot.on('send', function (message) {
switch (message.text) {
case 'ChooseOption':
connector.processMessage("show menu");
break;
case 'ReloadedChooseOption':
done();
break;
default:
assert(false);
break;
}
});
connector.processMessage('test');
});
it('should load a diffierent dialog using beginDialogAction().', function (done) {
var connector = new builder.ConsoleConnector();
var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session) {
builder.Prompts.text(session, "ChooseFood");
}).beginDialogAction('foodMenu', '/menu', {
matches: /show menu/i,
dialogArgs: { title: 'FoodOptions' }
});
bot.dialog('/menu', function (session, args) {
var title = args && args.title ? args.title : 'NoTitle';
session.send(title);
});
bot.on('send', function (message) {
switch (message.text) {
case 'ChooseFood':
connector.processMessage("show menu");
break;
case 'FoodOptions':
done();
break;
default:
assert(false);
break;
}
});
connector.processMessage('test');
});
it('should end the current conversation using endConversationAction().', function (done) {
var connector = new builder.ConsoleConnector();
var bot = new builder.UniversalBot(connector);
bot.dialog('/', function (session) {
builder.Prompts.text(session, "ChooseFood");
}).endConversationAction('quit', "goodbye", { matches: /goodbye/i });
bot.on('send', function (message) {
switch (message.text) {
case 'ChooseFood':
connector.processMessage("goodbye");
break;
case 'goodbye':
done();
break;
default:
assert(false);
break;
}
});
connector.processMessage('test');
});
});

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc