From ddb7998820820ecfe0cc97f94500338d87039302 Mon Sep 17 00:00:00 2001 From: Scott Gellock Date: Sat, 16 Feb 2019 14:54:07 -0800 Subject: [PATCH] Fixes 1246, EmptyBot missing appID and appPassword from Adapter constructor (#1249) - add appId and appPassword pulling from process.env - update JavaScript - update TypeScript - bump version patch number --- .../generators/app/templates/empty/index.js | 5 ++++- .../generators/app/templates/empty/index.ts | 5 ++++- generators/generator-botbuilder/package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/generators/generator-botbuilder/generators/app/templates/empty/index.js b/generators/generator-botbuilder/generators/app/templates/empty/index.js index 87746c13da..d583c78ab4 100644 --- a/generators/generator-botbuilder/generators/app/templates/empty/index.js +++ b/generators/generator-botbuilder/generators/app/templates/empty/index.js @@ -18,7 +18,10 @@ server.listen(process.env.port || process.env.PORT || 3978, () => { // Create adapter. // See https://aka.ms/about-bot-adapter to learn more about .bot file its use and bot configuration. -const adapter = new BotFrameworkAdapter(); +const adapter = new BotFrameworkAdapter({ + appId: process.env.microsoftAppID, + appPassword: process.env.microsoftAppPassword +}); // Catch-all for errors. adapter.onTurnError = async (context, error) => { diff --git a/generators/generator-botbuilder/generators/app/templates/empty/index.ts b/generators/generator-botbuilder/generators/app/templates/empty/index.ts index a86fab7d95..d4de5b8a4f 100644 --- a/generators/generator-botbuilder/generators/app/templates/empty/index.ts +++ b/generators/generator-botbuilder/generators/app/templates/empty/index.ts @@ -18,7 +18,10 @@ server.listen(process.env.port || process.env.PORT || 3978, () => { // Create adapter. // See https://aka.ms/about-bot-adapter to learn more about .bot file its use and bot configuration. -const adapter = new BotFrameworkAdapter(); +const adapter = new BotFrameworkAdapter({ + appId: process.env.microsoftAppID, + appPassword: process.env.microsoftAppPassword +}); // Catch-all for errors. adapter.onTurnError = async (context, error) => { diff --git a/generators/generator-botbuilder/package.json b/generators/generator-botbuilder/package.json index 5b439f5fb1..f56b7a3b97 100644 --- a/generators/generator-botbuilder/package.json +++ b/generators/generator-botbuilder/package.json @@ -1,6 +1,6 @@ { "name": "generator-botbuilder", - "version": "4.2.5", + "version": "4.2.6", "description": "A yeoman generator for creating bots using Bot Framework v4", "homepage": "https://github.com/Microsoft/BotBuilder-Samples/tree/master/generators/generator-botbuilder", "author": {