Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
update package versions to point to latest botkit
Browse files Browse the repository at this point in the history
  • Loading branch information
benbrown committed May 20, 2019
1 parent 486ce40 commit d1fbf00
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-facebook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"botbuilder": "^4.4.0",
"botkit": "^4.0.1",
"botkit": "^4.0.2",
"debug": "^4.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-hangouts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"dependencies": {
"botbuilder": "^4.4.0",
"googleapis": "^34.0.0",
"botkit": "^4.0.1",
"botkit": "^4.0.2",
"debug": "^4.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-slack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@slack/client": "^4.7.0",
"botbuilder": "^4.4.0",
"botkit": "^4.0.1",
"botkit": "^4.0.2",
"debug": "^4.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-twilio-sms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"botbuilder": "^4.4.0",
"botkit": "^4.0.1",
"botkit": "^4.0.2",
"debug": "^4.1.0",
"twilio": "^3.29.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"url": "https://github.com/howdyai/botkit.git"
},
"dependencies": {
"botkit": "^4.0.1",
"botkit": "^4.0.2",
"botbuilder": "^4.4.0",
"debug": "^4.1.0",
"url": "^0.11.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/botbuilder-adapter-webex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"url": "https://github.com/howdyai/botkit.git"
},
"dependencies": {
"botkit": "^4.0.1",
"botkit": "^4.0.2",
"botbuilder": "^4.4.0",
"ciscospark": "^1.32.23",
"debug": "^4.1.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/botkit-plugin-cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
"url": "https://github.com/howdyai/botkit.git"
},
"dependencies": {
"botbuilder": "^4.4.0",
"debug": "^4.1.0",
"botkit": "^4.0.1"
"botkit": "^4.0.2"
},
"devDependencies": {
"@types/express": "^4.16.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"botkit": "^4.0.1",
"botkit-plugin-cms": "^1.0.0",
"botkit": "^4.0.2",
"botkit-plugin-cms": "^1.0.1",
"botbuilder-storage-mongodb":"^0.9.5",
"dotenv": "^7.0.0"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* This module demonstrates the use of the typing indicator in a conversation, and when using bot.reply
* Tell your bot "typing dialog" or "typing reply" to see this in action.
*/
module.exports = function(controller) {

let typing = new BotkitConversation('typing', controller);

typing.say('I am going to type for a while now...');
typing.addAction('typing');

// start the typing indicator
typing.addMessage({type: 'typing'}, 'typing');
// trigger a gotoThread, which gives us an opportunity to delay the next message
typing.addAction('next_thread','typing');

typing.addMessage('typed!','next_thread');

// use the before handler to delay the next message
typing.before('next_thread', async() => {
return new Promise((resolve, reject) => {
// simulate some long running process
setTimeout(resolve, 3000);
});
});

controller.addDialog(typing);

controller.hears('typing dialog', 'message', async(bot, message) => {
await bot.beginDialog('typing');
});

controller.hears('typing reply', 'message', async(bot, message) => {

await bot.reply(message, {type: 'typing'});

setTimeout(async () => {
// will have to reset context because turn has now ended.
await bot.changeContext(message.reference);
await bot.reply(message, 'Typed!');
}, 1000);

});
};
18 changes: 9 additions & 9 deletions packages/testbot/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ const basicAuth = require('express-basic-auth');
const { BotkitCMSHelper } = require('botkit-plugin-cms');

// const { SlackAdapter, SlackMessageTypeMiddleware, SlackIdentifyBotsMiddleware, SlackEventMiddleware } = require('botbuilder-adapter-slack');
const { WebexAdapter } = require('botbuilder-adapter-webex');
// const { WebAdapter } = require('botbuilder-adapter-web');
// const { WebexAdapter } = require('botbuilder-adapter-webex');
const { WebAdapter } = require('botbuilder-adapter-web');
// const { FacebookAdapter, FacebookEventTypeMiddleware } = require('botbuilder-adapter-facebook');
// const { HangoutsAdapter } = require('botbuilder-adapter-hangouts');
// const { TwilioAdapter } = require('botbuilder-adapter-twilio-sms');
Expand All @@ -33,12 +33,12 @@ if (process.env.MONGO_URI) {
* Configure the Webex Teams adapter
* ----------------------------------------------------------------------
*/
const adapter = new WebexAdapter({
enable_incomplete: true,
// access_token: process.env.WEBEX_ACCESS_TOKEN,
// public_address: process.env.WEBEX_PUBLIC_ADDRESS,
secret: 'random-secret-1234',
})
// const adapter = new WebexAdapter({
// enable_incomplete: true,
// // access_token: process.env.WEBEX_ACCESS_TOKEN,
// // public_address: process.env.WEBEX_PUBLIC_ADDRESS,
// secret: 'random-secret-1234',
// })

/* ----------------------------------------------------------------------
* .--. .-. .-.
Expand Down Expand Up @@ -114,7 +114,7 @@ const adapter = new WebexAdapter({
* Configure the Websocket adapter
* ----------------------------------------------------------------------
*/
// const adapter = new WebAdapter({});
const adapter = new WebAdapter({});

// const adapter = new FacebookAdapter({
// // enable_incomplete: true,
Expand Down
12 changes: 12 additions & 0 deletions packages/testbot/features/websocket_features.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ module.exports = function(controller) {
await bot.beginDialog('typing');
});

controller.hears('typing reply', 'message', async(bot, message) => {

await bot.reply(message, {type: 'typing'});

setTimeout(async () => {
// will have to reset context because turn has now ended.
await bot.changeContext(message.reference);
await bot.reply(message, 'Typed!');
}, 1000);

});

}

}

0 comments on commit d1fbf00

Please sign in to comment.