├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── SDKV4-Samples ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── _config.yml ├── dotnet_core │ ├── ComplexDialogBot │ │ ├── BotBuilder.ruleset │ │ ├── ComplexDialogBot.cs │ │ ├── ComplexDialogBot.csproj │ │ ├── ComplexDialogBotAccessors.cs │ │ ├── DeploymentScripts │ │ │ └── MsbotClone │ │ │ │ └── bot.recipe │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── UserProfile.cs │ │ ├── appsettings.json │ │ ├── complex-dialog.bot │ │ └── wwwroot │ │ │ └── default.htm │ ├── DialogInterruptionsBot │ │ ├── BotBuilder.ruleset │ │ ├── DeploymentScripts │ │ │ └── MsbotClone │ │ │ │ └── bot.recipe │ │ ├── DialogInterruptionsBot.cs │ │ ├── DialogInterruptionsBot.csproj │ │ ├── DialogInterruptionsBotAccessors.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── UserProfile.cs │ │ ├── appsettings.json │ │ ├── dialog-interruptions.bot │ │ └── wwwroot │ │ │ └── default.htm │ ├── DialogPromptBot │ │ ├── DeploymentScripts │ │ │ └── MsbotClone │ │ │ │ └── bot.recipe │ │ ├── DialogPromptBot.cs │ │ ├── DialogPromptBot.csproj │ │ ├── DialogPromptBot.ruleset │ │ ├── DialogPromptBot.xml │ │ ├── DialogPromptBotAccessors.cs │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── appsettings.json │ │ ├── dialog-prompt.bot │ │ └── wwwroot │ │ │ └── default.htm │ ├── PromptUsersForInput │ │ ├── ConversationFlow.cs │ │ ├── CustomPromptBot.cs │ │ ├── CustomPromptBot.ruleset │ │ ├── CustomPromptBotAccessors.cs │ │ ├── DeploymentScripts │ │ │ └── MsbotClone │ │ │ │ └── bot.recipe │ │ ├── Program.cs │ │ ├── PromptUsersForInput.csproj │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── UserProfile.cs │ │ ├── appsettings.json │ │ ├── custom-prompt.bot │ │ └── wwwroot │ │ │ └── default.htm │ ├── StateBot │ │ ├── ConversationData.cs │ │ ├── DeploymentScripts │ │ │ └── MsbotClone │ │ │ │ └── bot.recipe │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── launchSettings.json │ │ ├── README.md │ │ ├── Startup.cs │ │ ├── StateBot.cs │ │ ├── StateBot.csproj │ │ ├── StateBot.ruleset │ │ ├── StateBot.sln │ │ ├── StateBot.xml │ │ ├── StateBotAccessors.cs │ │ ├── UserProfile.cs │ │ ├── appsettings.json │ │ ├── state.bot │ │ └── wwwroot │ │ │ └── default.htm │ ├── nlp-with-dispatch │ │ ├── QnAMaker.tsv │ │ ├── home-automation.json │ │ ├── nlp-with-dispatchDispatch.json │ │ └── weather.json │ └── nlp-with-luis │ │ └── reminders-with-entities.json └── js │ ├── DialogPromptBot │ ├── .env │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── bot.js │ ├── deploymentScripts │ │ └── msbotClone │ │ │ └── bot.recipe │ ├── dialog-prompt.bot │ ├── index.js │ └── package.json │ ├── PromptUsersForInput │ ├── .env │ ├── .eslintrc.js │ ├── README.md │ ├── bot.js │ ├── deploymentScripts │ │ └── msbotClone │ │ │ └── bot.recipe │ ├── index.js │ ├── package.json │ ├── resources │ │ └── echo.chat │ └── simplePrompts.bot │ ├── complexDialogBot │ ├── .eslintrc.js │ ├── .gitignore │ ├── ComplexDialogBot.bot │ ├── README.md │ ├── bot.js │ ├── deploymentScripts │ │ └── msbotClone │ │ │ └── bot.recipe │ ├── iisnode.yml │ ├── index.js │ ├── package.json │ └── web.config │ ├── nlp-with-dispatch │ ├── QnAMaker.tsv │ ├── home-automation.json │ ├── nlp-with-dispatchDispatch.json │ └── weather.json │ ├── nlp-with-luis │ └── reminders-with-entities.json │ └── stateBot │ ├── .env │ ├── .eslintrc.js │ ├── .gitignore │ ├── README.md │ ├── bot.js │ ├── deploymentScripts │ └── msbotClone │ │ └── bot.recipe │ ├── index.js │ ├── package.json │ ├── resources │ └── echo.chat │ └── stateBot.bot ├── SECURITY.md ├── StackOverflow-Bot ├── .gitignore ├── DialogAnalyzerFunc │ ├── AnalyzeDialog.cs │ ├── Clients │ │ ├── DialogAnalyzerClient.cs │ │ └── DialogDataInterpreter.cs │ ├── DialogAnalyzerFunc.csproj │ ├── Extensions │ │ ├── EnumerableExtensions.cs │ │ └── HttpExtensions.cs │ ├── Models │ │ ├── ComputerVisionImageAnalysisResult.cs │ │ ├── DialogAnalysisResult.cs │ │ ├── HandwritingRecognitionResult.cs │ │ ├── ImageTextRegion.cs │ │ └── TextAnalyticsResult.cs │ ├── Services │ │ ├── ComputerVisionService.cs │ │ └── TextAnalyticsService.cs │ ├── Utilities │ │ ├── HttpClientUtility.cs │ │ └── StringUtility.cs │ └── host.json ├── LICENSE ├── README.md ├── StackBot │ ├── Dockerfile │ ├── StackBot.njsproj │ ├── data │ │ ├── jokes.json │ │ ├── luis.json │ │ └── smalltalk.tsv │ ├── dialogs │ │ ├── brain.js │ │ ├── joke.js │ │ ├── keywordPrompt.js │ │ ├── languages.js │ │ ├── menu.js │ │ ├── screenshot.js │ │ ├── search.js │ │ └── smalltalk.js │ ├── index.js │ ├── lib │ │ ├── attachments.js │ │ ├── bingsearchclient.js │ │ ├── cognitiveservices.js │ │ ├── dialoganalyzerclient.js │ │ ├── qnaclient.js │ │ ├── sentimentanalyzerclient.js │ │ └── smalltalk.js │ ├── package-lock.json │ ├── package.json │ └── static │ │ └── index.html ├── StackCode │ ├── StackCode-0.1.1.vsix │ ├── directline.png │ ├── out │ │ ├── src │ │ │ ├── bot │ │ │ │ └── bot.html │ │ │ ├── extension.js │ │ │ └── extension.js.map │ │ └── test │ │ │ ├── extension.test.js │ │ │ ├── extension.test.js.map │ │ │ ├── index.js │ │ │ └── index.js.map │ ├── package-lock.json │ ├── package.json │ ├── src │ │ ├── bot │ │ │ └── bot.html │ │ └── extension.ts │ └── tsconfig.json ├── StackOverflowBot.sln └── env.template ├── _config.yml ├── blog-samples ├── CSharp │ ├── AzureSql-StateClient │ │ ├── Microsoft.Bot.Sample.AzureSql.sln │ │ ├── Microsoft.Bot.Sample.AzureSql │ │ │ ├── App_Start │ │ │ │ └── WebApiConfig.cs │ │ │ ├── Controllers │ │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ │ └── RootDialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Microsoft.Bot.Sample.AzureSql.csproj │ │ │ ├── Migrations │ │ │ │ ├── 201707121827490_Initial Setup.Designer.cs │ │ │ │ ├── 201707121827490_Initial Setup.cs │ │ │ │ ├── 201707121827490_Initial Setup.resx │ │ │ │ └── Configuration.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SqlStateService │ │ │ │ ├── SqlBotDataContext.cs │ │ │ │ ├── SqlBotDataEntity.cs │ │ │ │ └── SqlBotDataStore.cs │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ │ └── README.md │ ├── Bot-Feedback-Sample │ │ ├── Bot-Feedback-Sample.sln │ │ ├── Bot-Feedback-Sample │ │ │ ├── App_Start │ │ │ │ └── WebApiConfig.cs │ │ │ ├── ApplicationInsights.config │ │ │ ├── Bot-Feedback-Sample.csproj │ │ │ ├── Connected Services │ │ │ │ └── Application Insights │ │ │ │ │ └── ConnectedService.json │ │ │ ├── Controllers │ │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ │ ├── FeedbackDialog.cs │ │ │ │ └── QnADialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ │ └── README.md │ ├── BotStateExport │ │ ├── .gitignore │ │ ├── BotStateExport │ │ │ ├── BotStateExport.sln │ │ │ └── BotStateExport │ │ │ │ ├── App.config │ │ │ │ ├── BotStateExport.csproj │ │ │ │ ├── DocumentDbBotDataStore.cs │ │ │ │ ├── Extensions.cs │ │ │ │ ├── Program.cs │ │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ │ ├── TableBotDataStore.cs │ │ │ │ └── packages.config │ │ └── README.md │ ├── Custom-State-BotBuilder-Azure-Sample │ │ ├── Azure-DocumentDB-Custom-State │ │ │ ├── App_Start │ │ │ │ └── WebApiConfig.cs │ │ │ ├── Azure-DocumentDB-Custom-State.csproj │ │ │ ├── Controllers │ │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ │ └── RootDialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── README.md │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ │ ├── Azure-Table-Custom-State │ │ │ ├── App_Start │ │ │ │ └── WebApiConfig.cs │ │ │ ├── Azure-Table-Custom-State.csproj │ │ │ ├── Controllers │ │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ │ └── RootDialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── README.md │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ │ ├── Custom-State-Sample.sln │ │ └── README.md │ ├── FacebookHandover │ │ ├── FacebookHandover.sln │ │ ├── FacebookModel │ │ │ ├── FacebookPassThreadControl.cs │ │ │ ├── FacebookPayload.cs │ │ │ ├── FacebookPsid.cs │ │ │ ├── FacebookRequestThreadControl.cs │ │ │ ├── FacebookStandby.cs │ │ │ ├── FacebookTakeThreadControl.cs │ │ │ └── FacebookThreadControlHelper.cs │ │ ├── Primary │ │ │ ├── Bots │ │ │ │ └── PrimaryBot.cs │ │ │ ├── Controllers │ │ │ │ └── BotController.cs │ │ │ ├── DeploymentTemplates │ │ │ │ ├── template-with-new-rg.json │ │ │ │ └── template-with-preexisting-rg.json │ │ │ ├── Primary.csproj │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ │ └── launchSettings.json │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── wwwroot │ │ │ │ └── default.htm │ │ ├── README.md │ │ └── Secondary │ │ │ ├── Bots │ │ │ └── SecondaryBot.cs │ │ │ ├── Controllers │ │ │ └── BotController.cs │ │ │ ├── DeploymentTemplates │ │ │ ├── template-with-new-rg.json │ │ │ └── template-with-preexisting-rg.json │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── Secondary.csproj │ │ │ ├── Startup.cs │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ └── wwwroot │ │ │ └── default.htm │ ├── Luis-Scorable-QnA │ │ ├── .gitignore │ │ ├── Luis-Scorable-Qna.sln │ │ └── Luis-Scorable-Qna │ │ │ ├── App_Start │ │ │ └── WebApiConfig.cs │ │ │ ├── Controllers │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ ├── CommonResponsesDialog.cs │ │ │ ├── CommonResponsesScorable.cs │ │ │ ├── JokeDialog.cs │ │ │ ├── LuisDialog.cs │ │ │ ├── QnaDialog.cs │ │ │ └── RootDialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Luis-Scorable-Qna-Demo.csproj │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ ├── MockChannel │ │ ├── App_Start │ │ │ └── WebApiConfig.cs │ │ ├── Controllers │ │ │ └── MockChannelController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── MockChannel.csproj │ │ ├── MockChannel.sln │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── README.md │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ └── packages.config │ ├── Qna-Rich-Cards │ │ ├── Qna-Rich-Cards.sln │ │ ├── Qna-Rich-Cards │ │ │ ├── AnswerFormats │ │ │ │ └── JsonQnaAnswer.cs │ │ │ ├── App_Start │ │ │ │ └── WebApiConfig.cs │ │ │ ├── Controllers │ │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ │ ├── QnaDialog.cs │ │ │ │ └── RootDialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── Qna-Rich-Cards.csproj │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ │ └── README.md │ ├── ScorableBotSample │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── README.md │ │ ├── ScorableBot │ │ │ ├── App_Start │ │ │ │ └── WebApiConfig.cs │ │ │ ├── Controllers │ │ │ │ └── MessagesController.cs │ │ │ ├── Dialogs │ │ │ │ ├── Balance │ │ │ │ │ ├── Current │ │ │ │ │ │ └── CheckBalanceCurrentDialog.cs │ │ │ │ │ ├── Savings │ │ │ │ │ │ └── CheckBalanceSavingsDialog.cs │ │ │ │ │ ├── ScorableCheckBalance.cs │ │ │ │ │ └── ScorableCheckBalanceDialog.cs │ │ │ │ ├── MakePayment │ │ │ │ │ ├── ScorableMakePayment.cs │ │ │ │ │ └── ScorableMakePaymentDialog.cs │ │ │ │ └── RootDialog.cs │ │ │ ├── Global.asax │ │ │ ├── Global.asax.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── ScorableBot.csproj │ │ │ ├── Web.Debug.config │ │ │ ├── Web.Release.config │ │ │ ├── Web.config │ │ │ ├── default.htm │ │ │ └── packages.config │ │ └── ScorableBotSample.sln │ └── TriviaBotSpeechSample │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── TriviaApp │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── Assets │ │ │ ├── Answer_2.png │ │ │ ├── Answer_3.png │ │ │ ├── Answer_4.png │ │ │ ├── BG.png │ │ │ ├── Chat_Categories.png │ │ │ ├── Check_Left_2_Player_Only.png │ │ │ ├── Check_Right.png │ │ │ ├── Dash_No_Labels.png │ │ │ ├── Dash_with_Labels.png │ │ │ ├── Icon_Bot.png │ │ │ ├── Icon_Mic.png │ │ │ ├── Icon_User.png │ │ │ ├── LargeTile.scale-100.png │ │ │ ├── LargeTile.scale-125.png │ │ │ ├── LargeTile.scale-150.png │ │ │ ├── LargeTile.scale-200.png │ │ │ ├── LargeTile.scale-400.png │ │ │ ├── LockScreenLogo.scale-200.png │ │ │ ├── ON_ALL.png │ │ │ ├── ON_Animals.png │ │ │ ├── ON_Art.png │ │ │ ├── ON_Film.png │ │ │ ├── ON_Geography.png │ │ │ ├── ON_Music.png │ │ │ ├── ON_Science.png │ │ │ ├── SmallTile.scale-100.png │ │ │ ├── SmallTile.scale-125.png │ │ │ ├── SmallTile.scale-150.png │ │ │ ├── SmallTile.scale-200.png │ │ │ ├── SmallTile.scale-400.png │ │ │ ├── SplashScreen.scale-100.png │ │ │ ├── SplashScreen.scale-125.png │ │ │ ├── SplashScreen.scale-150.png │ │ │ ├── SplashScreen.scale-200.png │ │ │ ├── SplashScreen.scale-400.png │ │ │ ├── Square150x150Logo.scale-100.png │ │ │ ├── Square150x150Logo.scale-125.png │ │ │ ├── Square150x150Logo.scale-150.png │ │ │ ├── Square150x150Logo.scale-200.png │ │ │ ├── Square150x150Logo.scale-400.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ │ │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ │ │ ├── Square44x44Logo.scale-100.png │ │ │ ├── Square44x44Logo.scale-125.png │ │ │ ├── Square44x44Logo.scale-150.png │ │ │ ├── Square44x44Logo.scale-200.png │ │ │ ├── Square44x44Logo.scale-400.png │ │ │ ├── Square44x44Logo.targetsize-16.png │ │ │ ├── Square44x44Logo.targetsize-24.png │ │ │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ │ │ ├── Square44x44Logo.targetsize-256.png │ │ │ ├── Square44x44Logo.targetsize-32.png │ │ │ ├── Square44x44Logo.targetsize-48.png │ │ │ ├── StoreLogo.png │ │ │ ├── Trivia.png │ │ │ ├── Wide310x150Logo.scale-100.png │ │ │ ├── Wide310x150Logo.scale-125.png │ │ │ ├── Wide310x150Logo.scale-150.png │ │ │ ├── Wide310x150Logo.scale-200.png │ │ │ ├── Wide310x150Logo.scale-400.png │ │ │ └── X_Left.png │ │ ├── BotConnection.cs │ │ ├── Converters │ │ │ └── BoolToVisibilityConverter.cs │ │ ├── MainPage.xaml │ │ ├── MainPage.xaml.cs │ │ ├── Package.appxmanifest │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Default.rd.xml │ │ ├── TriviaApp.csproj │ │ ├── ViewModels │ │ │ ├── AnswerCard.cs │ │ │ ├── ChatCard.cs │ │ │ ├── CountdownTimer.cs │ │ │ └── ObservableDictionary.cs │ │ ├── packages.config │ │ └── project.json │ │ ├── TriviaBot │ │ ├── App_Start │ │ │ └── WebApiConfig.cs │ │ ├── Assets │ │ │ ├── Trivia.png │ │ │ ├── a_sunshine_intro_09.wav │ │ │ ├── tv_gameshow_bell_01.wav │ │ │ └── tv_gameshow_buzzer_03.wav │ │ ├── Controllers │ │ │ └── MessagesController.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── Luis │ │ │ ├── LuisEntity.cs │ │ │ ├── LuisIntent.cs │ │ │ ├── LuisResult.cs │ │ │ └── QueryLuis.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Runtime │ │ │ ├── BotState.cs │ │ │ ├── Categories.cs │ │ │ ├── EnumExtensions.cs │ │ │ ├── Extensions.cs │ │ │ ├── Responses.cs │ │ │ ├── SsmlWrapper.cs │ │ │ ├── TriviaResponse.cs │ │ │ └── Utility.cs │ │ ├── Shared │ │ │ ├── AppEntities.cs │ │ │ └── MessageType.cs │ │ ├── TriviaBot.csproj │ │ ├── TriviaDialog.cs │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── default.htm │ │ └── packages.config │ │ ├── TriviaBotLU.json │ │ └── TriviaBotSpeechSample.sln ├── Node │ ├── Blog-CustomSTate-CosmosDB │ │ └── package-lock.json │ ├── Blog-CustomState-CosmosDB │ │ ├── README.md │ │ ├── app.js │ │ └── package.json │ ├── Blog-Qna-Attachments │ │ ├── README.md │ │ ├── app.js │ │ ├── package-lock.json │ │ └── package.json │ └── Blog-Redux-Bot │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ ├── app.js │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── public │ │ └── index.html │ │ └── redux │ │ ├── conversationActions.js │ │ ├── dialogActions.js │ │ ├── loadStore.js │ │ ├── reducer.js │ │ └── sagas │ │ ├── default.js │ │ └── dialog.js ├── README.md └── images │ ├── app-insights-metrics.png │ ├── bot-channels-ngrok.png │ ├── direct-line-secret-url.png │ ├── ngrok-forward.png │ ├── qna-portal.png │ ├── qna-rich-cards.png │ ├── redux-abs-logo.png │ ├── redux-bot-02.png │ ├── redux-store-02.png │ └── suggested-actions-feedback.png ├── docs-samples ├── CSharp │ └── Simple-LUIS-Notes-Sample │ │ ├── Notes.json │ │ ├── Simple-LUIS-Notes-Sample.sln │ │ ├── Simple-LUIS-Notes-Sample │ │ ├── App_Start │ │ │ └── WebApiConfig.cs │ │ ├── Controllers │ │ │ └── MessagesController.cs │ │ ├── Dialogs │ │ │ └── SimpleNoteDialog.cs │ │ ├── Global.asax │ │ ├── Global.asax.cs │ │ ├── NotesBot.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Web.Debug.config │ │ ├── Web.Release.config │ │ ├── Web.config │ │ ├── default.htm │ │ └── packages.config │ │ ├── VSIX │ │ ├── BotBuilderVSIX_V3.zip │ │ └── readme.md │ │ ├── images │ │ ├── bot-builder-dotnet-luis-message-flow-bot-code-notes.png │ │ ├── dotnet-notes-sample-emulator.png │ │ └── notes-sample-emulator.png │ │ └── readme.md ├── Node │ └── basics-naturalLanguage │ │ ├── Notes.json │ │ ├── basicNote-intentDialog.js │ │ ├── basicNote.js │ │ ├── images │ │ ├── bot-builder-nodejs-luis-message-flow-bot-code-notes.png │ │ ├── bot-builder-nodejs-use-luis-create-note-interruption.png │ │ ├── bot-builder-nodejs-use-luis-create-note-output.png │ │ └── bot-builder-nodejs-use-luis-read-note-output.png │ │ └── readme.md ├── README.md ├── V4 │ └── JS │ │ └── contosocafebot-luis-dialogs │ │ ├── .gitignore │ │ ├── .vscode │ │ └── launch.json │ │ ├── cafeLUISModel.json │ │ ├── graphics │ │ └── run-bot.png │ │ ├── lib │ │ ├── CafeLUISModel.d.ts │ │ ├── CafeLUISModel.js │ │ ├── CafeLUISModel.js.map │ │ ├── luisbot.d.ts │ │ ├── luisbot.js │ │ └── luisbot.js.map │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── readme.md │ │ ├── src │ │ ├── .vscode │ │ │ └── launch.json │ │ ├── CafeLUISModel.ts │ │ └── luisbot.ts │ │ └── tsconfig.json ├── v3Node │ └── startNewDialog │ │ └── botadapter.js └── web-chat-speech │ ├── index.html │ ├── readme.md │ └── webchat-sample-speech.png └── swagger ├── ConnectorAPI.json └── StateAPI.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bot Framework Samples 2 | This repo contains samples that are specifically used in the blog posts. You can find additional [SDK V4](https://github.com/Microsoft/BotBuilder-Samples/tree/master/samples) and [SDK V3](https://github.com/Microsoft/BotBuilder-Samples/tree/v3-sdk-samples) in the BotBuilder-Samples repo. 3 | 4 | ## Contributing 5 | 6 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 7 | -------------------------------------------------------------------------------- /SDKV4-Samples/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /SDKV4-Samples/README.md: -------------------------------------------------------------------------------- 1 | # Bot Framework Samples 2 | 3 | This branch is for Bot Builder SDK V4 samples used in the documentation. 4 | 5 | ## Contributing 6 | 7 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 8 | -------------------------------------------------------------------------------- /SDKV4-Samples/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/BotBuilder.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/ComplexDialogBot.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | BotBuilder.ruleset 6 | 7 | 8 | 9 | 10 | Always 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/DeploymentScripts/MsbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "24", 7 | "name": "Sample", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "complex-dialog-Bot" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "complex-dialog-Insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "complex-dialog-Blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3978/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "_5.MultiTurn_Prompts_Bot": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3978/" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/UserProfile.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.BotBuilderSamples 5 | { 6 | using System.Collections.Generic; 7 | 8 | /// Contains information about a user. 9 | public class UserProfile 10 | { 11 | /// Gets or sets the user's name. 12 | /// The user's name. 13 | public string Name { get; set; } 14 | 15 | /// Gets or sets the user's age. 16 | /// The user's age. 17 | public int Age { get; set; } 18 | 19 | /// Gets or sets the list of companies the user wants to review. 20 | /// The list of companies the user wants to review. 21 | public List CompaniesToReview { get; set; } = new List(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "botFilePath": "complex-dialog.bot", 3 | "botFileSecret": "" 4 | } 5 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/ComplexDialogBot/complex-dialog.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "complex-dialog-bot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "24" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/BotBuilder.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/DeploymentScripts/MsbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "24", 7 | "name": "Sample", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "complex-dialog-Bot" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "complex-dialog-Insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "complex-dialog-Blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/DialogInterruptionsBot.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.0 5 | BotBuilder.ruleset 6 | Microsoft.BotBuilderSamples 7 | 8 | 9 | 10 | 11 | Always 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3978/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "DialogInterruptions_Sample": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3978/" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/UserProfile.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.BotBuilderSamples 5 | { 6 | using System.Collections.Generic; 7 | 8 | /// Contains information about a user. 9 | public class UserProfile 10 | { 11 | /// Gets or sets the user's name. 12 | /// The user's name. 13 | public string Name { get; set; } 14 | 15 | /// Gets or sets the user's age. 16 | /// The user's age. 17 | public int Age { get; set; } 18 | 19 | /// Gets or sets the list of companies the user wants to review. 20 | /// The list of companies the user wants to review. 21 | public List CompaniesToReview { get; set; } = new List(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "botFilePath": "dialog-interruptions.bot", 3 | "botFileSecret": "" 4 | } 5 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogInterruptionsBot/dialog-interruptions.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dialog-interruptions-bot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "24" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogPromptBot/DeploymentScripts/MsbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "DialogPromptBot-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "DialogPromptBot-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "DialogPromptBot-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogPromptBot/DialogPromptBot.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogPromptBot/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3978/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "PromptsBot": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3978/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogPromptBot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "botFilePath": "dialog-prompt.bot", 3 | "botFileSecret": "" 4 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/DialogPromptBot/dialog-prompt.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PromptsBot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "1" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/ConversationFlow.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.BotBuilderSamples 7 | { 8 | public class ConversationFlow 9 | { 10 | // Identifies the last question asked. 11 | public enum Question 12 | { 13 | Name, 14 | Age, 15 | Date, 16 | None, // Our last action did not involve a question. 17 | } 18 | 19 | // The last question asked. 20 | public Question LastQuestionAsked { get; set; } = Question.None; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/CustomPromptBot.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/DeploymentScripts/MsbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "CustomPromptBot-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "CustomPromptBot-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "CustomPromptBot-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3978/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Bot_Builder_Echo_Bot_V43": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3978/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/UserProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.BotBuilderSamples 7 | { 8 | public class UserProfile 9 | { 10 | public string Name { get; set; } 11 | 12 | public int? Age { get; set; } 13 | 14 | public string Date { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "botFilePath": "custom-prompt.bot", 3 | "botFileSecret": "" 4 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/PromptUsersForInput/custom-prompt.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CustomPromptBot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "1" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/ConversationData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace Microsoft.BotBuilderSamples 7 | { 8 | // Defines a state property used to track conversation data. 9 | public class ConversationData 10 | { 11 | // The time-stamp of the most recent incoming message. 12 | public string Timestamp { get; set; } 13 | 14 | // The ID of the user's channel. 15 | public string ChannelId { get; set; } 16 | 17 | // Track whether we have already asked the user's name 18 | public bool PromptedUserForName { get; set; } = false; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/DeploymentScripts/MsbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "StateBot-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "StateBot-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "StateBot-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3978/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "StateBot": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3978/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/StateBot.ruleset: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/StateBot.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2043 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StateBot", "StateBot.csproj", "{70EECF7F-1978-4587-9E6D-6371EC3A727B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {70EECF7F-1978-4587-9E6D-6371EC3A727B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {70EECF7F-1978-4587-9E6D-6371EC3A727B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {70EECF7F-1978-4587-9E6D-6371EC3A727B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {70EECF7F-1978-4587-9E6D-6371EC3A727B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {D6A9E094-666B-42FD-A3C9-2929F55D978E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/UserProfile.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace Microsoft.BotBuilderSamples 10 | { 11 | // Defines a state property used to track information about the user. 12 | public class UserProfile 13 | { 14 | public string Name { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "botFilePath": "state.bot", 3 | "botFileSecret": "" 4 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/StateBot/state.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "StateBot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "1" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/dotnet_core/nlp-with-dispatch/QnAMaker.tsv: -------------------------------------------------------------------------------- 1 | Question Answer Source Metadata 2 | hi Hello! QnAMaker.tsv 3 | greetings Hello! QnAMaker.tsv 4 | good morning Hello! QnAMaker.tsv 5 | good evening Hello! QnAMaker.tsv 6 | What are you? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 7 | What? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 8 | What do you do? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 9 | Who are you? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 10 | What is your name? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 11 | What should I call you? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 12 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/DialogPromptBot/.env: -------------------------------------------------------------------------------- 1 | botFilePath=dialog-prompt.bot 2 | botFileSecret= 3 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/DialogPromptBot/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "rules": { 4 | "semi": [2, "always"], 5 | "indent": [2, 4], 6 | "no-return-await": 0, 7 | "space-before-function-paren": [2, { 8 | "named": "never", 9 | "anonymous": "never", 10 | "asyncArrow": "always" 11 | }], 12 | "template-curly-spacing": [2, "always"] 13 | } 14 | }; -------------------------------------------------------------------------------- /SDKV4-Samples/js/DialogPromptBot/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env -------------------------------------------------------------------------------- /SDKV4-Samples/js/DialogPromptBot/deploymentScripts/msbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "DialogPromptBot-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "DialogPromptBot-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "DialogPromptBot-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /SDKV4-Samples/js/DialogPromptBot/dialog-prompt.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DialogPromptBot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "1" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/js/DialogPromptBot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dialog-prompt-bot", 3 | "version": "1.0.0", 4 | "description": "Bot from the prompt-users-using-dialogs topic", 5 | "author": "Microsoft Bot Builder Yeoman Generator v4.0.10", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "build": "echo \"Error: no build specified\" && exit 1", 11 | "start": "node ./index.js", 12 | "watch": "nodemon ./index.js" 13 | }, 14 | "dependencies": { 15 | "botbuilder": "^4.2.1", 16 | "botbuilder-dialogs": "^4.2.1", 17 | "botframework-config": "^4.1.5", 18 | "dotenv": "^6.0.0", 19 | "restify": "^6.3.4" 20 | }, 21 | "devDependencies": { 22 | "eslint": "^5.6.0", 23 | "eslint-config-standard": "^12.0.0", 24 | "eslint-plugin-import": "^2.14.0", 25 | "eslint-plugin-node": "^7.0.1", 26 | "eslint-plugin-promise": "^4.0.1", 27 | "eslint-plugin-standard": "^4.0.0", 28 | "nodemon": "^1.18.4", 29 | "@types/node": "10.10.2", 30 | "@types/restify": "7.2.4" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/PromptUsersForInput/.env: -------------------------------------------------------------------------------- 1 | botFilePath=simplePrompts.bot 2 | botFileSecret= 3 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/PromptUsersForInput/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "rules": { 4 | "semi": [2, "always"], 5 | "indent": [2, 4], 6 | "no-return-await": 0, 7 | "space-before-function-paren": [2, { 8 | "named": "never", 9 | "anonymous": "never", 10 | "asyncArrow": "always" 11 | }], 12 | "template-curly-spacing": [2, "always"] 13 | } 14 | }; -------------------------------------------------------------------------------- /SDKV4-Samples/js/PromptUsersForInput/deploymentScripts/msbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "simplePrompts-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "simplePrompts-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "simplePrompts-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /SDKV4-Samples/js/PromptUsersForInput/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simplePrompts", 3 | "version": "1.0.0", 4 | "description": "Sample code for Create your own prompts to gather user input", 5 | "author": "Microsoft Bot Builder Yeoman Generator v4.0.10", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "build": "echo \"Error: no build specified\" && exit 1", 11 | "start": "node ./index.js", 12 | "watch": "nodemon ./index.js" 13 | }, 14 | "dependencies": { 15 | "@microsoft/recognizers-text-suite": "^1.1.4", 16 | "botbuilder": "^4.0.6", 17 | "botframework-config": "^4.0.6", 18 | "dotenv": "^6.0.0", 19 | "restify": "^6.3.4" 20 | }, 21 | "devDependencies": { 22 | "eslint": "^5.6.0", 23 | "eslint-config-standard": "^12.0.0", 24 | "eslint-plugin-import": "^2.14.0", 25 | "eslint-plugin-node": "^7.0.1", 26 | "eslint-plugin-promise": "^4.0.1", 27 | "eslint-plugin-standard": "^4.0.0", 28 | "nodemon": "^1.18.4", 29 | "@types/node": "10.10.2", 30 | "@types/restify": "7.2.4" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/PromptUsersForInput/resources/echo.chat: -------------------------------------------------------------------------------- 1 | user=Vishwac 2 | bot=EchoBot 3 | 4 | user: Hi 5 | bot: 1: You said "Hi" 6 | user: Hello 7 | bot: 2: You said "Hello" 8 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/PromptUsersForInput/simplePrompts.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "simplePrompts", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "1" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /SDKV4-Samples/js/complexDialogBot/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "rules": { 4 | "semi": [2, "always"], 5 | "indent": [2, 4], 6 | "no-return-await": 0, 7 | "space-before-function-paren": [2, { 8 | "named": "never", 9 | "anonymous": "never", 10 | "asyncArrow": "always" 11 | }], 12 | "template-curly-spacing": [2, "always"] 13 | } 14 | }; -------------------------------------------------------------------------------- /SDKV4-Samples/js/complexDialogBot/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env -------------------------------------------------------------------------------- /SDKV4-Samples/js/complexDialogBot/deploymentScripts/msbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "ComplexDialogBot-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "ComplexDialogBot-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "ComplexDialogBot-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /SDKV4-Samples/js/complexDialogBot/iisnode.yml: -------------------------------------------------------------------------------- 1 | nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\8.9.4\node.exe" -------------------------------------------------------------------------------- /SDKV4-Samples/js/complexDialogBot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ComplexDialogBot", 3 | "version": "1.0.0", 4 | "description": "Sample code for the how to topic for creating advanced conversation flow", 5 | "author": "Microsoft Bot Builder Yeoman Generator v4.0.10", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "build": "echo \"Error: no build specified\" && exit 1", 11 | "start": "node ./index.js", 12 | "watch": "nodemon ./index.js" 13 | }, 14 | "dependencies": { 15 | "botbuilder": "^4.0.6", 16 | "botbuilder-dialogs": "^4.2.0-preview.2251", 17 | "botframework-config": "^4.0.6", 18 | "dotenv": "^6.0.0", 19 | "restify": "^6.3.4" 20 | }, 21 | "devDependencies": { 22 | "eslint": "^5.6.0", 23 | "eslint-config-standard": "^12.0.0", 24 | "eslint-plugin-import": "^2.14.0", 25 | "eslint-plugin-node": "^7.0.1", 26 | "eslint-plugin-promise": "^4.0.1", 27 | "eslint-plugin-standard": "^4.0.0", 28 | "nodemon": "^1.18.4", 29 | "@types/node": "10.10.2", 30 | "@types/restify": "7.2.4" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/nlp-with-dispatch/QnAMaker.tsv: -------------------------------------------------------------------------------- 1 | Question Answer Source Metadata 2 | hi Hello! QnAMaker.tsv 3 | greetings Hello! QnAMaker.tsv 4 | good morning Hello! QnAMaker.tsv 5 | good evening Hello! QnAMaker.tsv 6 | What are you? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 7 | What? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 8 | What do you do? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 9 | Who are you? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 10 | What is your name? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 11 | What should I call you? I am the LUIS-QnAMaker Dispatch bot! This sample demonstrates using several LUIS applications and QnA Maker knowledge base using dispatch. QnAMaker.tsv 12 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/.env: -------------------------------------------------------------------------------- 1 | botFilePath=stateBot.bot 2 | botFileSecret= 3 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard", 3 | "rules": { 4 | "semi": [2, "always"], 5 | "indent": [2, 4], 6 | "no-return-await": 0, 7 | "space-before-function-paren": [2, { 8 | "named": "never", 9 | "anonymous": "never", 10 | "asyncArrow": "always" 11 | }], 12 | "template-curly-spacing": [2, "always"] 13 | } 14 | }; -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/deploymentScripts/msbotClone/bot.recipe: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "resources": [ 4 | { 5 | "type": "endpoint", 6 | "id": "1", 7 | "name": "development", 8 | "url": "http://localhost:3978/api/messages" 9 | }, 10 | { 11 | "type": "endpoint", 12 | "id": "2", 13 | "name": "production", 14 | "url": "https://your-bot-url.azurewebsites.net/api/messages" 15 | }, 16 | { 17 | "type": "abs", 18 | "id": "3", 19 | "name": "stateBot-abs" 20 | }, 21 | { 22 | "type": "appInsights", 23 | "id": "4", 24 | "name": "stateBot-insights" 25 | }, 26 | { 27 | "type": "blob", 28 | "id": "5", 29 | "name": "stateBot-blob", 30 | "container": "botstatestore" 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stateBot", 3 | "version": "1.0.0", 4 | "description": "Demonstrates how to set up user and conversation state.", 5 | "author": "Microsoft Bot Builder Yeoman Generator v4.0.10", 6 | "license": "MIT", 7 | "main": "index.js", 8 | "scripts": { 9 | "test": "echo \"Error: no test specified\" && exit 1", 10 | "build": "echo \"Error: no build specified\" && exit 1", 11 | "start": "node ./index.js", 12 | "watch": "nodemon ./index.js" 13 | }, 14 | "dependencies": { 15 | "botbuilder": "^4.0.6", 16 | "botframework-config": "^4.0.6", 17 | "dotenv": "^6.0.0", 18 | "restify": "^6.3.4" 19 | }, 20 | "devDependencies": { 21 | "eslint": "^5.6.0", 22 | "eslint-config-standard": "^12.0.0", 23 | "eslint-plugin-import": "^2.14.0", 24 | "eslint-plugin-node": "^7.0.1", 25 | "eslint-plugin-promise": "^4.0.1", 26 | "eslint-plugin-standard": "^4.0.0", 27 | "nodemon": "^1.18.4", 28 | "@types/node": "10.10.2", 29 | "@types/restify": "7.2.4" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/resources/echo.chat: -------------------------------------------------------------------------------- 1 | user=Vishwac 2 | bot=EchoBot 3 | 4 | user: Hi 5 | bot: 1: You said "Hi" 6 | user: Hello 7 | bot: 2: You said "Hello" 8 | -------------------------------------------------------------------------------- /SDKV4-Samples/js/stateBot/stateBot.bot: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stateBot", 3 | "services": [ 4 | { 5 | "type": "endpoint", 6 | "name": "development", 7 | "endpoint": "http://localhost:3978/api/messages", 8 | "appId": "", 9 | "appPassword": "", 10 | "id": "1" 11 | } 12 | ], 13 | "padlock": "", 14 | "version": "2.0" 15 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/DialogAnalyzerFunc/DialogAnalyzerFunc.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net461 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | Never 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /StackOverflow-Bot/DialogAnalyzerFunc/Extensions/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace DialogAnalyzerFunc.Extensions 7 | { 8 | public static class EnumerableExtensions 9 | { 10 | public static IEnumerable> ToTuples(this IEnumerable values) 11 | { 12 | if (values.Count() % 2 != 0) 13 | { 14 | throw new ArgumentException("Values does not have an even number of items."); 15 | } 16 | 17 | List> results = new List>(); 18 | 19 | if (values.Count() == 0) 20 | { 21 | return results; 22 | } 23 | 24 | for (int index = 0; index < values.Count(); index += 2) 25 | { 26 | results.Add(new Tuple(values.ElementAt(index), values.ElementAt(index + 1))); 27 | } 28 | 29 | return results; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /StackOverflow-Bot/DialogAnalyzerFunc/Models/TextAnalyticsResult.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace DialogAnalyzerFunc.Models 5 | { 6 | [DataContract] 7 | public class TextAnalyticsResult 8 | { 9 | [DataMember(Name = "documents")] 10 | public T[] Results { get; set; } 11 | } 12 | 13 | [DataContract] 14 | public class TextAnalyticsKeyPhrasesResult 15 | { 16 | [DataMember(Name = "id")] 17 | public string Id { get; set; } 18 | 19 | [DataMember(Name = "keyPhrases")] 20 | public string[] KeyPhrases { get; set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /StackOverflow-Bot/DialogAnalyzerFunc/Utilities/StringUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace DialogAnalyzerFunc.Utilities 6 | { 7 | public static class StringUtility 8 | { 9 | /// 10 | /// Get combined text with delimeter or default value 11 | /// 12 | public static string GetTextOrDefault(IEnumerable values, string defaultValue, string delim = ", ") 13 | { 14 | if (values?.Count() > 0 == false || values.All(v => string.IsNullOrEmpty(v) == true)) 15 | { 16 | return defaultValue; 17 | } 18 | 19 | values = values.Where(v => string.IsNullOrEmpty(v) == false); 20 | 21 | return string.Join(delim, values).Trim(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /StackOverflow-Bot/DialogAnalyzerFunc/host.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:8-onbuild 2 | EXPOSE 3978 3 | RUN npm install 4 | CMD ["npm", "run", "start"] 5 | -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/dialogs/brain.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | bot.dialog('sobot:brain', [ 3 | async (session) => { 4 | session.send("Here are the Cognitive services that I use to help you today..."); 5 | var servicesMessage = attachments.buildCongitiveServicesMessageWithAttachments(session); 6 | return session.endDialog(servicesMessage); 7 | } 8 | ]).triggerAction({ 9 | matches: 'Brain' 10 | }); 11 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/dialogs/joke.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | // Tells the user a fun joke. 3 | bot.dialog('sobot:joke', [ 4 | (session) => { 5 | session.send("Here's a fun joke… 🙃"); 6 | tellAJoke(session); 7 | session.endDialog("Feel free to ask me another question, or even ask for a joke!"); 8 | return; 9 | } 10 | ]).triggerAction({ 11 | matches: ['Joke', /^Brighten my day/i] 12 | }); 13 | 14 | const tellAJoke = (session) => { 15 | let usedJoke = pickAJoke(jokes.items); 16 | session.send(usedJoke); 17 | return; 18 | } 19 | 20 | const pickAJoke = (jokes) => { 21 | let randomIndex = getRandomInt(0, jokes.length); 22 | return jokes[randomIndex].body_markdown; 23 | } 24 | 25 | const getRandomInt = (min, max) => { 26 | min = Math.ceil(min); 27 | max = Math.floor(max); 28 | return Math.floor(Math.random() * (max - min + 1)) + min; 29 | } 30 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/dialogs/keywordPrompt.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | // Ask the user what they'd like to look for. 3 | bot.dialog('sobot:keywordPrompt', [ 4 | async (session, args) => { 5 | session.sendTyping(); 6 | builder.Prompts.text(session, 'What would you like me to search for?'); 7 | }, 8 | async (session, results) => { 9 | session.sendTyping(); 10 | bingSearchQuery(session, { query: cleanQueryString(results.response, false) }); 11 | } 12 | ]).triggerAction({ 13 | matches: [/I want to ask a question|Search/i] 14 | }); 15 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/dialogs/languages.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | // This bot can speak *all* languages! 3 | bot.dialog('sobot:languages', [ 4 | async (session) => { 5 | session.endDialog("Hmm…. I speak JavaScript, SQL, Java, C#, Python, and more..."); 6 | } 7 | ]).triggerAction({ 8 | matches: 'Languages' 9 | }); 10 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/dialogs/menu.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | // Shows off a menu with all the capabilities. 3 | bot.dialog('sobot:menu', [ 4 | async (session) => { 5 | let msg = attachments.buildMenuMessageWithAttachments(session); 6 | session.endDialog(msg); 7 | } 8 | ]).triggerAction({ 9 | matches: 'Help' 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/dialogs/search.js: -------------------------------------------------------------------------------- 1 | module.exports = () => { 2 | // Perform a search and respond with results. 3 | bot.dialog('sobot:search', [ 4 | async (session, args) => { 5 | session.sendTyping(); 6 | let userText = session.message.text.toLowerCase(); 7 | bingSearchQuery(session, { query: cleanQueryString(userText, false) }); 8 | } 9 | ]).triggerAction({ 10 | matches: ['Search', 'None'] 11 | }); 12 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/lib/cognitiveservices.js: -------------------------------------------------------------------------------- 1 | var services = [{ 2 | title: "Text Analytics API", 3 | description: "A cloud-based service that provides advanced NLP over raw text to detect sentiment, key phrases, and language.", 4 | url: "https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/" 5 | }, { 6 | title: "Bing Custom Search", 7 | description: "An easy-to-use, ad-free, commercial-grade search tool that lets you deliver the results you want.", 8 | url: "https://azure.microsoft.com/en-us/services/cognitive-services/bing-custom-search/" 9 | }, { 10 | title: "Computer Vision API", 11 | description: "Extract rich information from images to categorize and process visual data to help curate your services.", 12 | url: "https://azure.microsoft.com/en-us/services/cognitive-services/computer-vision/" 13 | }, { 14 | title: "LUIS", 15 | description: "Understand language contextually, so your app communicates with people in the way they speak.", 16 | url: "https://azure.microsoft.com/en-us/services/cognitive-services/language-understanding-intelligent-service/" 17 | }]; 18 | 19 | module.exports = services; -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/lib/sentimentanalyzerclient.js: -------------------------------------------------------------------------------- 1 | const request = require('request-promise'); 2 | 3 | function SentimentAnalyzerClient (opts) { 4 | if (!opts.key) throw new Error('Key is required.'); 5 | 6 | this.key = opts.key; 7 | } 8 | 9 | SentimentAnalyzerClient.prototype.post = async (opts, cb) => { 10 | if (!opts.text) throw new Error('Text is required'); 11 | cb = cb || (() => { }); 12 | 13 | const url = `${process.env.TEXT_ANALYTICS_URL}/sentiment`; 14 | 15 | const content = { 16 | documents: [{ 17 | language: "en", 18 | id: "1", 19 | text: opts.text.trim() 20 | }] 21 | }; 22 | 23 | const options = { 24 | method: 'POST', 25 | uri: url, 26 | body: content, 27 | json: true, 28 | headers: { 29 | "Ocp-Apim-Subscription-Key": this.key, 30 | "Content-Type": "application/json" 31 | } 32 | }; 33 | 34 | await request(options) 35 | .then((body) => { 36 | // POST succeeded 37 | return cb(null, body); 38 | }) 39 | .catch((err) => { 40 | // POST failed 41 | return cb(err); 42 | }); 43 | } 44 | 45 | module.exports = SentimentAnalyzerClient; 46 | -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stackbot", 3 | "version": "1.0.0", 4 | "description": "A bot that helps you code. Built with Bot Framework and Microsoft Cognitive Services.", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js" 8 | }, 9 | "author": "Microsoft Inc.", 10 | "license": "MIT", 11 | "dependencies": { 12 | "botbuilder": "^3.9.0", 13 | "devnull": "0.0.12", 14 | "lodash": "^4.17.10", 15 | "request": "^2.87.0", 16 | "request-promise": "^4.2.2", 17 | "restify": "^5.2.1" 18 | }, 19 | "engines": { 20 | "node": "8.1.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /StackOverflow-Bot/StackBot/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 28 | 29 | 30 |
31 | 32 | 42 | 43 | -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/StackCode-0.1.1.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/StackOverflow-Bot/StackCode/StackCode-0.1.1.vsix -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/directline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/StackOverflow-Bot/StackCode/directline.png -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/out/test/extension.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | // 3 | // Note: This example test is leveraging the Mocha test framework. 4 | // Please refer to their documentation on https://mochajs.org/ for help. 5 | // 6 | Object.defineProperty(exports, "__esModule", { value: true }); 7 | // The module 'assert' provides assertion methods from node 8 | const assert = require("assert"); 9 | // Defines a Mocha test suite to group tests of similar kind together 10 | suite("Extension Tests", () => { 11 | // Defines a Mocha unit test 12 | test("Something 1", () => { 13 | assert.equal(-1, [1, 2, 3].indexOf(5)); 14 | assert.equal(-1, [1, 2, 3].indexOf(0)); 15 | }); 16 | }); 17 | //# sourceMappingURL=extension.test.js.map -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/out/test/extension.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.test.js","sourceRoot":"","sources":["../../test/extension.test.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,kEAAkE;AAClE,wEAAwE;AACxE,EAAE;;AAEF,2DAA2D;AAC3D,iCAAiC;AAOjC,qEAAqE;AACrE,KAAK,CAAC,iBAAiB,EAAE;IAErB,4BAA4B;IAC5B,IAAI,CAAC,aAAa,EAAE;QAChB,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/out/test/index.js: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | var testRunner = require('vscode/lib/testrunner'); 13 | // You can directly control Mocha options by uncommenting the following lines 14 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 15 | testRunner.configure({ 16 | ui: 'tdd', 17 | useColors: true // colored output from test results 18 | }); 19 | module.exports = testRunner; 20 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/out/test/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../test/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,8EAA8E;AAC9E,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,kFAAkF;AAClF,iFAAiF;AACjF,gFAAgF;AAChF,oDAAoD;AAEpD,IAAI,UAAU,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAElD,6EAA6E;AAC7E,mGAAmG;AACnG,UAAU,CAAC,SAAS,CAAC;IACjB,EAAE,EAAE,KAAK;IACT,SAAS,EAAE,IAAI,CAAC,mCAAmC;CACtD,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC"} -------------------------------------------------------------------------------- /StackOverflow-Bot/StackCode/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "lib": [ 7 | "es6" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "." 11 | }, 12 | "exclude": [ 13 | "node_modules", 14 | ".vscode-test" 15 | ] 16 | } -------------------------------------------------------------------------------- /StackOverflow-Bot/env.template: -------------------------------------------------------------------------------- 1 | export BOTBUILDER_APP_ID= 2 | export BOTBUILDER_APP_PASSWORD= 3 | export KB_ID= 4 | export QNA_KEY= 5 | export QNA_URL= 6 | export LUIS_MODEL= 7 | export DIALOG_ANALYZER_CLIENTID= 8 | export DIALOG_ANALYZER_KEY= 9 | export DIALOG_ANALYZER_URL= 10 | export BING_SEARCH_CONFIG= 11 | export BING_SEARCH_KEY= 12 | export TEXT_ANALYTICS_KEY= 13 | export TEXT_ANALYTICS_URL= -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.6 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Bot.Sample.AzureSql", "Microsoft.Bot.Sample.AzureSql\Microsoft.Bot.Sample.AzureSql.csproj", "{18C42588-D8F0-48A9-A7AF-02A5BF8252A9}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {18C42588-D8F0-48A9-A7AF-02A5BF8252A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {18C42588-D8F0-48A9-A7AF-02A5BF8252A9}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {18C42588-D8F0-48A9-A7AF-02A5BF8252A9}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {18C42588-D8F0-48A9-A7AF-02A5BF8252A9}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Microsoft.Bot.Sample.AzureSql.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Microsoft.Bot.Builder.Dialogs; 3 | using Microsoft.Bot.Builder.Dialogs.Internals; 4 | using Microsoft.Bot.Connector; 5 | using Microsoft.Bot.Sample.AzureSql.SqlStateService; 6 | using System.Web.Http; 7 | 8 | namespace Microsoft.Bot.Sample.AzureSql 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | 16 | var builder = new ContainerBuilder(); 17 | 18 | builder.RegisterModule(new DialogModule()); 19 | 20 | var store = new SqlBotDataStore("BotDataContextConnectionString"); 21 | 22 | builder.Register(c => new CachingBotDataStore(store, CachingBotDataStoreConsistencyPolicy.LastWriteWins)) 23 | .As>() 24 | .AsSelf() 25 | .InstancePerLifetimeScope(); 26 | 27 | builder.Update(Conversation.Container); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/Migrations/201707121827490_Initial Setup.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | namespace Microsoft.Bot.Sample.AzureSql.Migrations 3 | { 4 | using System.CodeDom.Compiler; 5 | using System.Data.Entity.Migrations; 6 | using System.Data.Entity.Migrations.Infrastructure; 7 | using System.Resources; 8 | 9 | [GeneratedCode("EntityFramework.Migrations", "6.1.3-40302")] 10 | public sealed partial class InitialSetup : IMigrationMetadata 11 | { 12 | private readonly ResourceManager Resources = new ResourceManager(typeof(InitialSetup)); 13 | 14 | string IMigrationMetadata.Id 15 | { 16 | get { return "201707121827490_Initial Setup"; } 17 | } 18 | 19 | string IMigrationMetadata.Source 20 | { 21 | get { return null; } 22 | } 23 | 24 | string IMigrationMetadata.Target 25 | { 26 | get { return Resources.GetString("Target"); } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/Migrations/Configuration.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Bot.Sample.AzureSql.Migrations 2 | { 3 | using System; 4 | using System.Data.Entity; 5 | using System.Data.Entity.Migrations; 6 | using System.Linq; 7 | 8 | internal sealed class Configuration : DbMigrationsConfiguration 9 | { 10 | public Configuration() 11 | { 12 | AutomaticMigrationsEnabled = false; 13 | } 14 | 15 | protected override void Seed(Microsoft.Bot.Sample.AzureSql.SqlStateService.SqlBotDataContext context) 16 | { 17 | // This method will be called after migrating to the latest version. 18 | 19 | // You can use the DbSet.AddOrUpdate() helper extension method 20 | // to avoid creating duplicate seed data. E.g. 21 | // 22 | // context.People.AddOrUpdate( 23 | // p => p.FullName, 24 | // new Person { FullName = "Andrew Peters" }, 25 | // new Person { FullName = "Brice Lambson" }, 26 | // new Person { FullName = "Rowan Miller" } 27 | // ); 28 | // 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/SqlStateService/SqlBotDataContext.cs: -------------------------------------------------------------------------------- 1 | using System.Data.Entity; 2 | 3 | 4 | namespace Microsoft.Bot.Sample.AzureSql.SqlStateService 5 | { 6 | public class SqlBotDataContext : DbContext 7 | { 8 | public SqlBotDataContext() 9 | : this("BotDataContextConnectionString") 10 | { 11 | } 12 | public SqlBotDataContext(string connectionStringName) 13 | : base(connectionStringName) 14 | { 15 | } 16 | public DbSet BotData { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/Microsoft.Bot.Sample.AzureSql/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /blog-samples/CSharp/AzureSql-StateClient/README.md: -------------------------------------------------------------------------------- 1 | # Explanation 2 | 3 | A example State Client using Sql Server for storage. 4 | 5 | # Setup 6 | 7 | 1) Register a bot with the Bot Framework at http://dev.botframework.com/ and add the AppId and AppPassword to Microsoft.Bot.Sample.AzureSql\Web.config. 8 | 9 | 2) Retrieve a WebChat secret from https://dev.botframework.com/bots/channels?id=[YourBotId]&channelId=webchat and add it to Microsoft.Bot.Sample.AzureSql\default.htm in place of [YourWebChatSecret]. 10 | 11 | 3) Create an Sql Server database and add the connection string to Microsoft.Bot.Sample.AzureSql\Web.config, overwriting the current [BotDataContextConnectionString]. 12 | 13 | 4) Execute 'update-database' from the Nuget Package Manager Console. This will create the SqlBotDataEntities table. 14 | 15 | 5) Publish the Bot as an Azure App Service, and add the public endpoint (https://[YourHostUrl]/api/messages) to the Bot Framework portal settings page. Make sure to use https instead of http in the url. 16 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Bot-Feedback-Sample/Bot-Feedback-Sample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.15 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bot-Feedback-Sample", "Bot-Feedback-Sample\Bot-Feedback-Sample.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {F417B28C-F273-42B3-8A2F-01C59DCEB6B6} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Bot-Feedback-Sample/Bot-Feedback-Sample/Connected Services/Application Insights/ConnectedService.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider", 3 | "Version": "8.8.712.1", 4 | "GettingStartedDocument": { 5 | "Uri": "" 6 | } 7 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Bot-Feedback-Sample/Bot-Feedback-Sample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Bot_Feedback_Sample.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Bot-Feedback-Sample/Bot-Feedback-Sample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Routing; 7 | 8 | namespace Bot_Feedback_Sample 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Bot-Feedback-Sample/Bot-Feedback-Sample/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Bot-Feedback-Sample/Bot-Feedback-Sample/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Bot_Feedback_Sample

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/BotStateExport/BotStateExport/BotStateExport.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2027 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotStateExport", "BotStateExport\BotStateExport.csproj", "{DA593586-7A94-43D4-8EF1-0474EFF6D2E0}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DA593586-7A94-43D4-8EF1-0474EFF6D2E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DA593586-7A94-43D4-8EF1-0474EFF6D2E0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DA593586-7A94-43D4-8EF1-0474EFF6D2E0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DA593586-7A94-43D4-8EF1-0474EFF6D2E0}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {2F9065FE-E24D-4377-AD1D-631E08ED7E57} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /blog-samples/CSharp/BotStateExport/BotStateExport/BotStateExport/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /blog-samples/CSharp/BotStateExport/BotStateExport/BotStateExport/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Microsoft.Bot.Builder.Azure 4 | { 5 | internal static class StringExtensions 6 | { 7 | private static readonly Dictionary _DefaultReplacementsForCharactersDisallowedByAzure = new Dictionary() { { "/", "|s|" }, { @"\", "|b|" }, { "#", "|h|" }, { "?", "|q|" } }; 8 | 9 | internal static string SanitizeForAzureKeys(this string input, Dictionary replacements = null) 10 | { 11 | var repmap = replacements ?? _DefaultReplacementsForCharactersDisallowedByAzure; 12 | return input.Trim().Replace("/", repmap["/"]).Replace(@"\", repmap[@"\"]).Replace("#", repmap["#"]).Replace("?", repmap["?"]); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /blog-samples/CSharp/BotStateExport/README.md: -------------------------------------------------------------------------------- 1 | This is some rough code for exporting an Azure Bot Service bot's bot state data. This version just dumps it to the console. -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-DocumentDB-Custom-State/Dialogs/RootDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Bot.Builder.Dialogs; 4 | using Microsoft.Bot.Connector; 5 | 6 | namespace Azure_Blob_Custom_State.Dialogs 7 | { 8 | [Serializable] 9 | public class RootDialog : IDialog 10 | { 11 | public Task StartAsync(IDialogContext context) 12 | { 13 | context.Wait(MessageReceivedAsync); 14 | 15 | return Task.CompletedTask; 16 | } 17 | 18 | private async Task MessageReceivedAsync(IDialogContext context, IAwaitable result) 19 | { 20 | var activity = await result as Activity; 21 | 22 | await context.PostAsync($"You said {activity.Text}"); 23 | 24 | context.Wait(MessageReceivedAsync); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-DocumentDB-Custom-State/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Azure_Blob_Custom_State.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-DocumentDB-Custom-State/README.md: -------------------------------------------------------------------------------- 1 | # Azure DocumentDB Sample 2 | 3 | This simple echo bots illustrates how to use your own Azure Table Storage to store the bot state. 4 | 5 | To use Azure Table Store, we configure the Autofac Dependency Injection in [Global.asax](Global.asax.cs). Particularly the following is the piece of code that configures injection of Azure DocumentDB (CosmosDB) Storage: 6 | 7 | >Note: DocumentDB was rebranded as CosmosDB - [see here](https://buildazure.com/2017/05/10/cosmosdb-the-new-documentdb-nosql-database-in-microsoft-azure/) for details 8 | 9 | ```csharp 10 | var store = new TableBotDataStore(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString); 11 | builder.Register(c => store) 12 | .Keyed>(AzureModule.Key_DataStore) 13 | .AsSelf() 14 | .SingleInstance(); 15 | ``` 16 | 17 | ## References 18 | - Documentation - [State Data for Bots in .NET](https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-state) 19 | - Source code for [BotBuilder-Azure on GitHub](https://github.com/Microsoft/BotBuilder-Azure) 20 | - Nuget packaget for .NET [Microsoft.Bot.Builder.Azure](https://www.nuget.org/packages/Microsoft.Bot.Builder.Azure/) 21 | - Get started with [Azure DocumentDB](https://docs.microsoft.com/en-us/azure/cosmos-db/create-documentdb-dotnet) 22 | 23 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-DocumentDB-Custom-State/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Azure_Blob_Custom_State

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-Table-Custom-State/Dialogs/RootDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Bot.Builder.Dialogs; 4 | using Microsoft.Bot.Connector; 5 | 6 | namespace Custom_State_Sample.Dialogs 7 | { 8 | [Serializable] 9 | public class RootDialog : IDialog 10 | { 11 | public Task StartAsync(IDialogContext context) 12 | { 13 | context.Wait(MessageReceivedAsync); 14 | 15 | return Task.CompletedTask; 16 | } 17 | 18 | private async Task MessageReceivedAsync(IDialogContext context, IAwaitable result) 19 | { 20 | var activity = await result as Activity; 21 | 22 | await context.PostAsync($"You said {activity.Text}"); 23 | 24 | context.Wait(MessageReceivedAsync); 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-Table-Custom-State/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Custom_State_Sample.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-Table-Custom-State/README.md: -------------------------------------------------------------------------------- 1 | # Azure Table Sample 2 | 3 | This simple echo bots illustrates how to use your own Azure Table Storage to store the bot state. 4 | 5 | To use Azure Table Store, we configure the Autofac Dependency Injection in [Global.asax](Global.asax.cs). Particularly the following is the piece of code that configures injection of Azure Table Storage: 6 | 7 | ```csharp 8 | var store = new TableBotDataStore(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString); 9 | builder.Register(c => store) 10 | .Keyed>(AzureModule.Key_DataStore) 11 | .AsSelf() 12 | .SingleInstance(); 13 | ``` 14 | 15 | ## References 16 | - Documentation - [State Data for Bots in .NET](https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-state) 17 | - Source code for [BotBuilder-Azure on GitHub](https://github.com/Microsoft/BotBuilder-Azure) 18 | - Nuget packaget for .NET [Microsoft.Bot.Builder.Azure](https://www.nuget.org/packages/Microsoft.Bot.Builder.Azure/) 19 | - Get started with [Azure Table Storage](https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-dotnet) -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/Azure-Table-Custom-State/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Custom_State_Sample

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Custom-State-BotBuilder-Azure-Sample/README.md: -------------------------------------------------------------------------------- 1 | # Custom state data for your Bots 2 | 3 | The [Bot Framework State Service](https://docs.microsoft.com/en-us/bot-framework/dotnet/bot-builder-dotnet-state) API is not recommended for production environments. Currently, every bot built with the SDK comes with this setting by default, but it is only meant for prototyping. 4 | 5 | These samples are simple echo bots which leverage the [Microsoft.Bot.Builder.Azure](https://www.nuget.org/packages/Microsoft.Bot.Builder.Azure/) Nuget package to easily create a custom state data store for your bots. Currently, the package supports seamless integration with [Azure Table storage](https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-how-to-use-dotnet) and [Azure DocumentDB](https://docs.microsoft.com/en-us/azure/cosmos-db/create-documentdb-dotnet). 6 | 7 | Creating a custom state store for your bot provides several benefits: 8 | - Improved latency for your Bot 9 | - Direct control over your bot's state data, which includes information about your users, conversation state, and conversation context. 10 | 11 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/FacebookModel/FacebookPassThreadControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Newtonsoft.Json; 6 | 7 | namespace FacebookModel 8 | { 9 | /// 10 | /// A Facebook thread control message, including appid of the new thread owner and an optional message to sent with the request 11 | /// 12 | /// 13 | public class FacebookPassThreadControl 14 | { 15 | /// 16 | /// The app id of the new owner. 17 | /// 18 | /// 19 | /// 263902037430900 for the page inbox. 20 | /// 21 | [JsonProperty("new_owner_app_id")] 22 | public string NewOwnerAppId; 23 | 24 | /// 25 | /// Message sent from the requester. 26 | /// 27 | /// 28 | /// Example: "i want the control!" 29 | /// 30 | [JsonProperty("metadata")] 31 | public string Metadata; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/FacebookModel/FacebookPsid.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Newtonsoft.Json; 5 | 6 | namespace FacebookModel 7 | { 8 | /// 9 | /// Defines a Facebook PSID. 10 | /// 11 | public class FacebookPsid 12 | { 13 | /// 14 | /// A Facebook page-scoped ID. 15 | /// 16 | [JsonProperty("id")] 17 | public string Id { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/FacebookModel/FacebookRequestThreadControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Newtonsoft.Json; 6 | 7 | namespace FacebookModel 8 | { 9 | /// 10 | /// A Facebook thread control message, including appid of requested thread owner and an optional message to send with the request 11 | /// 12 | /// 13 | public class FacebookRequestThreadControl 14 | { 15 | /// 16 | /// The app id of the requested owner. 17 | /// 18 | /// 19 | /// 263902037430900 for the page inbox. 20 | /// 21 | [JsonProperty("requested_owner_app_id")] 22 | public string RequestedOwnerAppId; // 263902037430900 for page 23 | 24 | /// 25 | /// Message sent from the requester. 26 | /// 27 | /// 28 | /// Example: "i want the control!" 29 | /// 30 | [JsonProperty("metadata")] 31 | public string Metadata; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/FacebookModel/FacebookTakeThreadControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Newtonsoft.Json; 6 | 7 | namespace FacebookModel 8 | { 9 | /// 10 | /// A Facebook thread control message, including appid of the previous thread owner and an optional message sent with the request 11 | /// 12 | /// 13 | public class FacebookTakeThreadControl 14 | { 15 | /// 16 | /// The app id of the previous owner. 17 | /// 18 | /// 19 | /// 263902037430900 for the page inbox. 20 | /// 21 | [JsonProperty("previous_owner_app_id")] 22 | public string PreviousOwnerAppId; 23 | 24 | /// 25 | /// Message sent from the requester. 26 | /// 27 | /// 28 | /// Example: "All yours!" 29 | /// 30 | [JsonProperty("metadata")] 31 | public string Metadata; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Primary/Controllers/BotController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.3.0 5 | 6 | using System.Threading.Tasks; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.Bot.Builder; 9 | using Microsoft.Bot.Builder.Integration.AspNet.Core; 10 | 11 | namespace Primary.Controllers 12 | { 13 | // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot 14 | // implementation at runtime. Multiple different IBot implementations running at different endpoints can be 15 | // achieved by specifying a more specific type for the bot constructor argument. 16 | [Route("api/messages")] 17 | [ApiController] 18 | public class BotController : ControllerBase 19 | { 20 | private readonly IBotFrameworkHttpAdapter Adapter; 21 | private readonly IBot Bot; 22 | 23 | public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) 24 | { 25 | Adapter = adapter; 26 | Bot = bot; 27 | } 28 | 29 | [HttpPost] 30 | public async Task PostAsync() 31 | { 32 | // Delegate the processing of the HTTP POST to the adapter. 33 | // The adapter will invoke the bot. 34 | await Adapter.ProcessAsync(Request, Response, Bot); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Primary/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.3.0 5 | 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | 9 | namespace Primary 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | CreateWebHostBuilder(args).Build().Run(); 16 | } 17 | 18 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 19 | WebHost.CreateDefaultBuilder(args) 20 | .UseStartup(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Primary/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3978/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Primary": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3978/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Primary/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Primary/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MicrosoftAppId": "", 3 | "MicrosoftAppPassword": "", 4 | "FacebookPageToken": "" 5 | } 6 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/README.md: -------------------------------------------------------------------------------- 1 | # Facebook Handovers 2 | 3 | This is the sample code for the handover protocol blog post. These two bots are meant to be running simultaneously, while each is connected to its own Facebook app. -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Secondary/Controllers/BotController.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.3.0 5 | 6 | using System.Threading.Tasks; 7 | using Microsoft.AspNetCore.Mvc; 8 | using Microsoft.Bot.Builder; 9 | using Microsoft.Bot.Builder.Integration.AspNet.Core; 10 | 11 | namespace Secondary.Controllers 12 | { 13 | // This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot 14 | // implementation at runtime. Multiple different IBot implementations running at different endpoints can be 15 | // achieved by specifying a more specific type for the bot constructor argument. 16 | [Route("api/messages")] 17 | [ApiController] 18 | public class BotController : ControllerBase 19 | { 20 | private readonly IBotFrameworkHttpAdapter Adapter; 21 | private readonly IBot Bot; 22 | 23 | public BotController(IBotFrameworkHttpAdapter adapter, IBot bot) 24 | { 25 | Adapter = adapter; 26 | Bot = bot; 27 | } 28 | 29 | [HttpPost] 30 | public async Task PostAsync() 31 | { 32 | // Delegate the processing of the HTTP POST to the adapter. 33 | // The adapter will invoke the bot. 34 | await Adapter.ProcessAsync(Request, Response, Bot); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Secondary/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // Generated with Bot Builder V4 SDK Template for Visual Studio EchoBot v4.3.0 5 | 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | 9 | namespace Secondary 10 | { 11 | public class Program 12 | { 13 | public static void Main(string[] args) 14 | { 15 | CreateWebHostBuilder(args).Build().Run(); 16 | } 17 | 18 | public static IWebHostBuilder CreateWebHostBuilder(string[] args) => 19 | WebHost.CreateDefaultBuilder(args) 20 | .UseStartup(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Secondary/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3979/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "Secondary": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:3979/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Secondary/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /blog-samples/CSharp/FacebookHandover/Secondary/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "MicrosoftAppId": "", 3 | "MicrosoftAppPassword": "", 4 | "FacebookPageToken": "" 5 | } 6 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2002 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Luis-Scorable-Qna-Demo", "Luis-Scorable-Qna\Luis-Scorable-Qna-Demo.csproj", "{9CB693F7-95B3-4055-955D-BC75BC2D706B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9CB693F7-95B3-4055-955D-BC75BC2D706B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9CB693F7-95B3-4055-955D-BC75BC2D706B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9CB693F7-95B3-4055-955D-BC75BC2D706B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9CB693F7-95B3-4055-955D-BC75BC2D706B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {76AE3092-2BB0-4A8C-9E81-A15B8E9D662E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/Dialogs/JokeDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Threading; 4 | using System.Threading.Tasks; 5 | using Microsoft.Bot.Builder.Dialogs; 6 | using Microsoft.Bot.Connector; 7 | 8 | namespace Scorable.Dialogs 9 | { 10 | [Serializable] 11 | public class JokeDialog : IDialog 12 | { 13 | public Task StartAsync(IDialogContext context) 14 | { 15 | // Confirmation that we're in the JokeDialog, forwarded from the LUIS dialog 16 | string response = "What time does the duck wake up? At the quack of dawn!"; 17 | 18 | context.PostAsync(response); 19 | 20 | return Task.CompletedTask; 21 | } 22 | 23 | private async Task MessageReceivedAsync(IDialogContext context, IAwaitable result) 24 | { 25 | var activity = await result as Activity; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/Dialogs/QnaDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.Bot.Connector; 6 | using Microsoft.Bot.Builder.Dialogs; 7 | using Microsoft.Bot.Builder.CognitiveServices.QnAMaker; 8 | using System.Configuration; 9 | using System.Net; 10 | 11 | namespace Scorable.Dialogs 12 | { 13 | public class QnaDialog : QnAMakerDialog 14 | { 15 | public QnaDialog(): base( 16 | new QnAMakerService(new QnAMakerAttribute(ConfigurationManager.AppSettings["QnaSubscriptionKey"], 17 | ConfigurationManager.AppSettings["QnaKnowledgebaseId"], "Hmm, I wasn't able to find an article about that. Can you try asking in a different way?", 0.5))) 18 | { 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/Dialogs/RootDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using Microsoft.Bot.Builder.Dialogs; 5 | using Microsoft.Bot.Connector; 6 | 7 | namespace Scorable.Dialogs 8 | { 9 | [Serializable] 10 | public class RootDialog : IDialog 11 | { 12 | public Task StartAsync(IDialogContext context) 13 | { 14 | context.Wait(MessageReceivedAsync); 15 | 16 | return Task.CompletedTask; 17 | } 18 | 19 | private async Task MessageReceivedAsync(IDialogContext context, IAwaitable result) 20 | { 21 | var activity = await result as Activity; 22 | await context.Forward(new LuisDialog(), ResumeAftelLuisDialog, activity, CancellationToken.None); 23 | } 24 | 25 | private async Task ResumeAftelLuisDialog(IDialogContext context, IAwaitable result) 26 | { 27 | context.Wait(MessageReceivedAsync); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Scorable.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Luis Scorable Qna Demo Bot

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Luis-Scorable-QnA/Luis-Scorable-Qna/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace MockChannel 7 | { 8 | public static class WebApiConfig 9 | { 10 | public static void Register(HttpConfiguration config) 11 | { 12 | // Web API configuration and services 13 | 14 | // Web API routes 15 | config.MapHttpAttributeRoutes(); 16 | 17 | config.Routes.MapHttpRoute( 18 | name: "DefaultApi", 19 | routeTemplate: "api/{controller}/{id}", 20 | defaults: new { id = RouteParameter.Optional } 21 | ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="MockChannel.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Routing; 7 | 8 | namespace MockChannel 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/MockChannel.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.2036 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MockChannel", "MockChannel.csproj", "{5BC119EB-69F3-45BE-A394-5AAD86D3D355}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5BC119EB-69F3-45BE-A394-5AAD86D3D355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5BC119EB-69F3-45BE-A394-5AAD86D3D355}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5BC119EB-69F3-45BE-A394-5AAD86D3D355}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5BC119EB-69F3-45BE-A394-5AAD86D3D355}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {AD9C2B50-4B24-45F5-A73F-A1DF4FCF1AC8} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/README.md: -------------------------------------------------------------------------------- 1 | # MockChannel 2 | When creating load tests as described in [Load testing a Bot](https://blog.botframework.com/2017/06/19/Load-Testing-A-Bot/) you need 3 | a service to pass as the activity.ServiceUrl. 4 | 5 | This is a sample implementation of that callback service. 6 | 7 | To use: 8 | * build and deploy (say http://yourmockservice.azurewebsites.net) 9 | * When posting an activity to your bot from your webTest, set the activity.ServiceUrl = "http://yourmockservice.azurewebsites.net" 10 | 11 | When you run your load test generating requests to your bot, when the bot posts back it will post back to the ServiceUrl 12 | in the activity which is this mock service. 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/MockChannel/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26430.14 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qna-Rich-Cards", "Qna-Rich-Cards\Qna-Rich-Cards.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/AnswerFormats/JsonQnaAnswer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace Qna_Rich_Cards.AnswerFormats 7 | { 8 | public class JsonQnaAnswer 9 | { 10 | public string title { get; set; } 11 | public string desc { get; set; } 12 | public string url { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Serialization; 4 | 5 | namespace Qna_Rich_Cards 6 | { 7 | public static class WebApiConfig 8 | { 9 | public static void Register(HttpConfiguration config) 10 | { 11 | // Json settings 12 | config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; 13 | config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); 14 | config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; 15 | JsonConvert.DefaultSettings = () => new JsonSerializerSettings() 16 | { 17 | ContractResolver = new CamelCasePropertyNamesContractResolver(), 18 | Formatting = Newtonsoft.Json.Formatting.Indented, 19 | NullValueHandling = NullValueHandling.Ignore, 20 | }; 21 | 22 | // Web API configuration and services 23 | 24 | // Web API routes 25 | config.MapHttpAttributeRoutes(); 26 | 27 | config.Routes.MapHttpRoute( 28 | name: "DefaultApi", 29 | routeTemplate: "api/{controller}/{id}", 30 | defaults: new { id = RouteParameter.Optional } 31 | ); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/Dialogs/RootDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Bot.Builder.Dialogs; 4 | using Microsoft.Bot.Connector; 5 | 6 | namespace Qna_Rich_Cards.Dialogs 7 | { 8 | [Serializable] 9 | public class RootDialog : IDialog 10 | { 11 | public Task StartAsync(IDialogContext context) 12 | { 13 | context.Wait(MessageReceivedAsync); 14 | 15 | return Task.CompletedTask; 16 | } 17 | 18 | private async Task MessageReceivedAsync(IDialogContext context, IAwaitable result) 19 | { 20 | var activity = await result as Activity; 21 | 22 | // calculate something for us to return 23 | int length = (activity.Text ?? string.Empty).Length; 24 | 25 | // return our reply to the user 26 | await context.PostAsync($"You sent {activity.Text} which was {length} characters"); 27 | 28 | context.Wait(MessageReceivedAsync); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Qna_Rich_Cards.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Routing; 7 | 8 | namespace Qna_Rich_Cards 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

Qna_Rich_Cards

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/Qna-Rich-Cards/Qna-Rich-Cards/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Http; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Serialization; 4 | 5 | namespace ScorableTest 6 | { 7 | public static class WebApiConfig 8 | { 9 | public static void Register(HttpConfiguration config) 10 | { 11 | // Json settings 12 | config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore; 13 | config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); 14 | config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented; 15 | JsonConvert.DefaultSettings = () => new JsonSerializerSettings() 16 | { 17 | ContractResolver = new CamelCasePropertyNamesContractResolver(), 18 | Formatting = Newtonsoft.Json.Formatting.Indented, 19 | NullValueHandling = NullValueHandling.Ignore, 20 | }; 21 | 22 | // Web API configuration and services 23 | 24 | // Web API routes 25 | config.MapHttpAttributeRoutes(); 26 | 27 | config.Routes.MapHttpRoute( 28 | name: "DefaultApi", 29 | routeTemplate: "api/{controller}/{id}", 30 | defaults: new { id = RouteParameter.Optional } 31 | ); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Controllers/MessagesController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net; 4 | using System.Net.Http; 5 | using System.Threading.Tasks; 6 | using System.Web.Http; 7 | using Microsoft.Bot.Builder.Dialogs; 8 | using Microsoft.Bot.Connector; 9 | using ScorableTest.Dialogs; 10 | 11 | namespace ScorableTest.Controllers 12 | { 13 | [BotAuthentication] 14 | public class MessagesController : ApiController 15 | { 16 | public async Task Post([FromBody] Activity activity) 17 | { 18 | if (activity.Type == ActivityTypes.ConversationUpdate && 19 | activity.MembersAdded.Any(m => m.Id == activity.Recipient.Id)) 20 | { 21 | var connector = new ConnectorClient(new Uri(activity.ServiceUrl)); 22 | var reply = activity.CreateReply($"[MessagesController] You can interrupt me with IScorable by saying 'check balance' or 'make payment' at any point. Otherwise, I will just echo back what you say to me!"); 23 | await connector.Conversations.ReplyToActivityAsync(reply); 24 | } 25 | else if (activity.Type == ActivityTypes.Message) 26 | { 27 | await Conversation.SendAsync(activity, () => new RootDialog()); 28 | } 29 | 30 | return Request.CreateResponse(HttpStatusCode.OK); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Dialogs/Balance/Current/CheckBalanceCurrentDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Web; 6 | using Microsoft.Bot.Builder.Dialogs; 7 | 8 | namespace ScorableTest.Dialogs.Balance.Current 9 | { 10 | [Serializable] 11 | public class CheckBalanceCurrentDialog : IDialog 12 | { 13 | // Entry point to the Dialog 14 | public async Task StartAsync(IDialogContext context) 15 | { 16 | await context.PostAsync("[CheckBalanceCurrentDialog] Your current account balance is £2000"); 17 | 18 | // State transition - complete this Dialog and remove it from the stack 19 | context.Done(new object()); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Dialogs/Balance/Savings/CheckBalanceSavingsDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Web; 6 | using Microsoft.Bot.Builder.Dialogs; 7 | 8 | namespace ScorableTest.Dialogs.Balance.Savings 9 | { 10 | [Serializable] 11 | public class CheckBalanceSavingsDialog : IDialog 12 | { // Entry point to the Dialog 13 | public async Task StartAsync(IDialogContext context) 14 | { 15 | await context.PostAsync("[CheckBalanceSavingsDialog] Your savings account balance is £5000"); 16 | 17 | // State transition - complete this Dialog and remove it from the stack 18 | context.Done(new object()); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Dialogs/RootDialog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Bot.Builder.Dialogs; 4 | using Microsoft.Bot.Connector; 5 | 6 | namespace ScorableTest.Dialogs 7 | { 8 | [Serializable] 9 | public class RootDialog : IDialog 10 | { 11 | public Task StartAsync(IDialogContext context) 12 | { 13 | context.PostAsync($"[RootDialog] I am the root dialog."); 14 | 15 | context.Wait(MessageReceivedAsync); 16 | 17 | return Task.CompletedTask; 18 | } 19 | 20 | private async Task MessageReceivedAsync(IDialogContext context, IAwaitable result) 21 | { 22 | var activity = await result as IMessageActivity; 23 | if (activity != null && activity.Type == ActivityTypes.Message) 24 | { 25 | int length = (activity.Text ?? string.Empty).Length; 26 | await context.PostAsync($"[RootDialog] You sent {activity.Text} which was {length} characters"); 27 | } 28 | context.Wait(MessageReceivedAsync); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="ScorableTest.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Http; 3 | using Autofac; 4 | using Microsoft.Bot.Builder.Dialogs; 5 | using Microsoft.Bot.Builder.Scorables; 6 | using Microsoft.Bot.Connector; 7 | using ScorableTest.Dialogs.Balance; 8 | using ScorableTest.Dialogs.MakePayment; 9 | 10 | namespace ScorableTest 11 | { 12 | public class WebApiApplication : HttpApplication 13 | { 14 | protected void Application_Start() 15 | { 16 | GlobalConfiguration.Configure(WebApiConfig.Register); 17 | 18 | // register our scorables 19 | var builder = new ContainerBuilder(); 20 | 21 | builder.RegisterType() 22 | .As>() 23 | .InstancePerLifetimeScope(); 24 | 25 | builder.RegisterType() 26 | .As>() 27 | .InstancePerLifetimeScope(); 28 | 29 | builder.Update(Conversation.Container); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

ScorableTest

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBot/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /blog-samples/CSharp/ScorableBotSample/ScorableBotSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26403.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScorableBot", "ScorableBot\ScorableBot.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Maxwell Miller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/App.xaml: -------------------------------------------------------------------------------- 1 |  8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Answer_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Answer_2.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Answer_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Answer_3.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Answer_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Answer_4.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/BG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/BG.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Chat_Categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Chat_Categories.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Check_Left_2_Player_Only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Check_Left_2_Player_Only.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Check_Right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Check_Right.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Dash_No_Labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Dash_No_Labels.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Dash_with_Labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Dash_with_Labels.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Icon_Bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Icon_Bot.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Icon_Mic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Icon_Mic.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Icon_User.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Icon_User.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-100.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-125.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-150.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LargeTile.scale-400.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_ALL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_ALL.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Animals.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Art.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Film.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Geography.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Geography.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Music.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Music.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Science.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/ON_Science.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-100.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-125.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-150.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SmallTile.scale-400.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/StoreLogo.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Trivia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Trivia.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/X_Left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Assets/X_Left.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/BotConnection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | namespace TrivaApp 4 | { 5 | public static class BotConnection 6 | { 7 | #error You must specify the direct line secret of the bot to talk to 8 | #error This requires first publishing the TriviaBot project and configuring it on https://dev.botframework.com/ 9 | public static string DirectLineSecret { get; } = "Your DirectLine secret here"; 10 | 11 | #error Please provide a Bing Speech API key, if the Cognitive Services speech recognizer or synthesizer are used." 12 | public static string BingSpeechKey { get; } = "Your Bing Speech API key here"; 13 | 14 | public static string ApplicationName { get; } = "TriviaApp"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Converters/BoolToVisibilityConverter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | using System; 4 | using Windows.UI.Xaml; 5 | using Windows.UI.Xaml.Data; 6 | 7 | namespace TrivaApp.Converters 8 | { 9 | public class BoolToVisibilityConverter : IValueConverter 10 | { 11 | public object Convert(object value, Type targetType, object parameter, string language) 12 | { 13 | if (parameter is string && (parameter as string).Equals("invert", StringComparison.CurrentCultureIgnoreCase)) 14 | { 15 | if (value is bool) 16 | { 17 | value = !(bool)value; 18 | } 19 | } 20 | 21 | if (value is bool && (bool)value) 22 | { 23 | return Visibility.Visible; 24 | } 25 | 26 | return Visibility.Collapsed; 27 | } 28 | 29 | public object ConvertBack(object value, Type targetType, object parameter, string language) 30 | { 31 | throw new NotImplementedException(); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("TrivaApp")] 8 | [assembly: AssemblyDescription("A speech-enabled trivia client app that is driven by a bot.")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("TriviaApp")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Version information for an assembly consists of the following four values: 17 | // 18 | // Major Version 19 | // Minor Version 20 | // Build Number 21 | // Revision 22 | // 23 | // You can specify all the values or you can default the Build and Revision Numbers 24 | // by using the '*' as shown below: 25 | // [assembly: AssemblyVersion("1.0.*")] 26 | [assembly: AssemblyVersion("1.0.0.0")] 27 | [assembly: AssemblyFileVersion("1.0.0.0")] 28 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/ViewModels/AnswerCard.cs: -------------------------------------------------------------------------------- 1 | namespace TrivaApp.ViewModels 2 | { 3 | internal class AnswerCard 4 | { 5 | public string Index { get; set; } 6 | public string AnswerText { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/ViewModels/ChatCard.cs: -------------------------------------------------------------------------------- 1 | using Windows.UI.Xaml; 2 | 3 | namespace TrivaApp.ViewModels 4 | { 5 | internal class ChatCard 6 | { 7 | public HorizontalAlignment BorderAlignment { get; set; } 8 | 9 | public string Message { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaApp/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.Bot.Client": "0.1.0-beta", 4 | "Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2", 5 | "Microsoft.Xaml.Behaviors.Uwp.Managed": "2.0.0", 6 | "Newtonsoft.Json": "9.0.1" 7 | }, 8 | "frameworks": { 9 | "uap10.0": {} 10 | }, 11 | "runtimes": { 12 | "win10-arm": {}, 13 | "win10-arm-aot": {}, 14 | "win10-x86": {}, 15 | "win10-x86-aot": {}, 16 | "win10-x64": {}, 17 | "win10-x64-aot": {} 18 | } 19 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/Trivia.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/Trivia.png -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/a_sunshine_intro_09.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/a_sunshine_intro_09.wav -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/tv_gameshow_bell_01.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/tv_gameshow_bell_01.wav -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/tv_gameshow_buzzer_03.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Assets/tv_gameshow_buzzer_03.wav -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="TriviaBot.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Routing; 7 | 8 | namespace TriviaBot 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Luis/LuisResult.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | using System.Collections.Generic; 4 | using System.Runtime.Serialization; 5 | 6 | namespace Luis 7 | { 8 | /// 9 | /// The data structure of the JSON returned by LUIS used for deserialization 10 | /// 11 | [DataContract] 12 | public class LuisResult 13 | { 14 | /// 15 | /// Gets or sets the LUIS query that this object was processed from 16 | /// 17 | [DataMember(Name = "query")] 18 | public string Query { get; set; } 19 | 20 | /// 21 | /// Gets the list of intents that the query might relate to 22 | /// 23 | [DataMember(Name = "intents")] 24 | public ICollection Intents { get; private set; } 25 | 26 | /// 27 | /// Gets the entities that were identified from the query 28 | /// 29 | [DataMember(Name = "entities")] 30 | public ICollection Entities { get; private set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Runtime/BotState.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | namespace TriviaBot.Runtime 4 | { 5 | public enum BotState 6 | { 7 | None, 8 | Trivia, 9 | SwitchCategory, 10 | WaitingForReengagement 11 | } 12 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Runtime/EnumExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | using System; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Reflection; 6 | 7 | namespace TriviaBot.Runtime 8 | { 9 | public static class EnumExtensions 10 | { 11 | public static string DisplayName(this Enum value) 12 | { 13 | var members = value?.GetType()?.GetMember(value.ToString()); 14 | if (members != null) 15 | { 16 | foreach (var member in members) 17 | { 18 | var displayName = member.GetCustomAttribute()?.GetName(); 19 | 20 | if (displayName?.Length > 0) 21 | { 22 | return displayName; 23 | } 24 | } 25 | } 26 | 27 | return value?.ToString(); 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Runtime/Extensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | 6 | namespace TriviaBot 7 | { 8 | public static class Extensions 9 | { 10 | public static string Normalize(this string msg) 11 | { 12 | return msg.ToLower().Trim().TrimEnd('.'); 13 | } 14 | 15 | public static bool NormalizedEquals(this string msg, string other) 16 | { 17 | return Normalize(msg) == Normalize(other); 18 | } 19 | 20 | public static bool ContainsIgnoreCase(this string msg, IEnumerable parts) 21 | { 22 | var msgL = msg?.ToLower(); 23 | return parts.Any(x => msgL?.Contains(x.ToLower()) == true); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Shared/AppEntities.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | using System.Collections.Generic; 4 | 5 | namespace TriviaBot.Shared 6 | { 7 | public class AppEntities 8 | { 9 | public string Type = "AppEntities"; 10 | 11 | public MessageType? MessageType; 12 | public IList TriviaAnswerOptions; 13 | } 14 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Shared/MessageType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | namespace TriviaBot.Shared 4 | { 5 | public enum MessageType 6 | { 7 | Statement, 8 | Question, 9 | GotItRight, 10 | GotItWrong, 11 | StartLightningMode, 12 | StopLightningMode, 13 | OutOfTime 14 | } 15 | } -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /blog-samples/CSharp/TriviaBotSpeechSample/TriviaBot/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

TriviaBot

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-CustomState-CosmosDB/app.js: -------------------------------------------------------------------------------- 1 | var builder = require('botbuilder'); 2 | var azure = require('botbuilder-azure'); 3 | var restify = require('restify'); 4 | 5 | // **UNCOMMENT THE FOLLOWING LINE TO CONNECT TO THE BOT FRAMEWORK EMULATOR 6 | //process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0; 7 | 8 | var documentDbOptions = { 9 | host: 'Your-Azure-DocumentDB-URI', 10 | masterKey: 'Your-Azure-Key', 11 | database: 'botdocdb', 12 | collection: 'botdata' 13 | }; 14 | 15 | var docDbClient = new azure.DocumentDbClient(documentDbOptions); 16 | 17 | var tableStorage = new azure.AzureBotStorage({ gzipData: false }, docDbClient); 18 | 19 | var connector = new builder.ChatConnector({ 20 | appId: process.env.MICROSOFT_APP_ID, 21 | appPassword: process.env.MICROSOFT_APP_PASSWORD 22 | }); 23 | 24 | var bot = new builder.UniversalBot(connector, function (session) { 25 | session.send("You said: %s", session.message.text); 26 | }).set('storage', tableStorage); 27 | 28 | var server = restify.createServer(); 29 | server.listen(process.env.port || process.env.PORT || 3978, function () { 30 | console.log('%s listening to %s', server.name, server.url); 31 | }); 32 | 33 | server.post('/api/messages', connector.listen()); 34 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-CustomState-CosmosDB/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "azure-extensions-bot", 3 | "version": "1.0.0", 4 | "main": "app.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "author": "MShim", 9 | "license": "ISC", 10 | "description": "", 11 | "dependencies": { 12 | "botbuilder": "^3.15.0", 13 | "botbuilder-azure": "^3.1.0", 14 | "restify": "^6.4.0" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Qna-Attachments/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qna-node-bot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "botbuilder": "^3.15.0", 13 | "botbuilder-cognitiveservices": "^1.2.0", 14 | "https": "^1.0.0", 15 | "restify": "^6.4.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Typescript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Matt Shim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "redux-bot", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "start": "npx concurrently --names \"bot,web\" --kill-others \"npm run start:bot\" \"npm run start:web\"", 8 | "start:bot": "npx node-dev .", 9 | "start:web": "npx serve -p 3000 public", 10 | "test": "jest" 11 | }, 12 | "private": true, 13 | "author": "", 14 | "license": "MIT", 15 | "dependencies": { 16 | "botbuilder": "^3.15.0", 17 | "dotenv": "^5.0.1", 18 | "redux": "^3.7.2", 19 | "redux-saga": "^0.16.0", 20 | "restify": "^6.4.0" 21 | }, 22 | "devDependencies": { 23 | "jest": "^22.4.3" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/redux/conversationActions.js: -------------------------------------------------------------------------------- 1 | const RESET = 'RESET'; 2 | const SET_CITY = 'SET_CITY'; 3 | const SET_USERNAME = 'SET_USERNAME'; 4 | 5 | function reset() { 6 | return { type: RESET }; 7 | } 8 | 9 | function setCity(city) { 10 | return { type: SET_CITY, payload: { city } }; 11 | } 12 | 13 | function setUsername(username) { 14 | return { type: SET_USERNAME, payload: { username } }; 15 | } 16 | 17 | module.exports = { 18 | RESET, 19 | SET_CITY, 20 | SET_USERNAME, 21 | 22 | reset, 23 | setCity, 24 | setUsername 25 | }; 26 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/redux/dialogActions.js: -------------------------------------------------------------------------------- 1 | const PROMPT_TEXT = 'DIALOG/PROMPT_TEXT'; 2 | const RECEIVE_MESSAGE = 'DIALOG/RECEIVE_MESSAGE'; 3 | const SEND_EVENT = 'DIALOG/SEND_EVENT'; 4 | const SEND_MESSAGE = 'DIALOG/SEND_MESSAGE'; 5 | const END_CONVERSATION = 'DIALOG/END_CONVERSATION'; 6 | 7 | function promptText(text) { 8 | return { type: PROMPT_TEXT, payload: { text } }; 9 | } 10 | 11 | function receiveMessage(text, attachments, result) { 12 | return { 13 | type: RECEIVE_MESSAGE, 14 | payload: { attachments, result, text } 15 | }; 16 | } 17 | 18 | function sendEvent(name, value) { 19 | return { 20 | type: SEND_EVENT, 21 | payload: { name, value } 22 | }; 23 | } 24 | 25 | function sendMessage(text, attachments) { 26 | return { 27 | type: SEND_MESSAGE, 28 | payload: { attachments, text } 29 | }; 30 | } 31 | 32 | function endConversation(text, attachments, result){ 33 | return { 34 | type: END_CONVERSATION, 35 | payload: { attachments, result, text } 36 | }; 37 | } 38 | 39 | module.exports = { 40 | PROMPT_TEXT, 41 | RECEIVE_MESSAGE, 42 | SEND_EVENT, 43 | SEND_MESSAGE, 44 | END_CONVERSATION, 45 | 46 | promptText, 47 | receiveMessage, 48 | sendEvent, 49 | sendMessage, 50 | endConversation 51 | }; 52 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/redux/loadStore.js: -------------------------------------------------------------------------------- 1 | const { applyMiddleware, createStore } = require('redux'); 2 | const { default: createSagaMiddleware } = require('redux-saga'); 3 | 4 | const createDefaultSaga = require('./sagas/default'); 5 | const createDialogSagas = require('./sagas/dialog'); 6 | const reducer = require('./reducer'); 7 | 8 | module.exports = function loadStore(session) { 9 | const saga = createSagaMiddleware(); 10 | const store = createStore( 11 | reducer, 12 | 13 | // Restore the store from conversationData 14 | session.conversationData, 15 | 16 | applyMiddleware( 17 | saga, 18 | store => next => action => { 19 | // Send action to web page for debugging 20 | session.send({ 21 | type: 'event', 22 | name: 'action', 23 | value: action 24 | }); 25 | 26 | return next(action); 27 | } 28 | ) 29 | ); 30 | 31 | store.subscribe(() => { 32 | // Save the store to conversationData 33 | session.conversationData = store.getState(); 34 | session.save(); 35 | 36 | // Send store state to web page for debugging 37 | session.send({ 38 | type: 'event', 39 | name: 'store', 40 | value: store.getState() 41 | }); 42 | }); 43 | 44 | saga.run(function* () { 45 | yield* createDialogSagas(session); 46 | yield* createDefaultSaga(session); 47 | }); 48 | 49 | return store; 50 | }; 51 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/redux/reducer.js: -------------------------------------------------------------------------------- 1 | const { RESET, SET_CITY, SET_USERNAME } = require('./conversationActions'); 2 | 3 | const DEFAULT_STATE = { 4 | city: null, 5 | username: null 6 | }; 7 | 8 | function conversationReducer(state = DEFAULT_STATE, action) { 9 | switch (action.type) { 10 | case RESET: 11 | state = DEFAULT_STATE; 12 | break; 13 | 14 | case SET_CITY: 15 | state = { ...state, city: action.payload.city }; 16 | break; 17 | 18 | case SET_USERNAME: 19 | state = { ...state, username: action.payload.username }; 20 | break; 21 | } 22 | 23 | return state; 24 | } 25 | 26 | module.exports = conversationReducer; 27 | -------------------------------------------------------------------------------- /blog-samples/Node/Blog-Redux-Bot/redux/sagas/dialog.js: -------------------------------------------------------------------------------- 1 | const builder = require('botbuilder'); 2 | const { takeEvery } = require('redux-saga/effects'); 3 | const DialogActions = require('../dialogActions'); 4 | 5 | module.exports = function* (session) { 6 | yield takeEvery(DialogActions.PROMPT_TEXT, function* (action) { 7 | builder.Prompts.text(session, action.payload.text); 8 | }); 9 | 10 | yield takeEvery(DialogActions.END_CONVERSATION, function* (action){ 11 | 12 | session.endConversation('Bye!'); 13 | }); 14 | 15 | yield takeEvery(DialogActions.SEND_EVENT, function* (action) { 16 | const { name, value } = action.payload; 17 | 18 | session.send({ type: 'event', name, value }); 19 | }); 20 | 21 | yield takeEvery(DialogActions.SEND_MESSAGE, function* (action) { 22 | const { attachments, text } = action.payload; 23 | 24 | message = new builder.Message(session); 25 | 26 | text && message.text(text); 27 | attachments && message.attachments(attachments); 28 | 29 | session.send(message); 30 | }); 31 | }; 32 | -------------------------------------------------------------------------------- /blog-samples/README.md: -------------------------------------------------------------------------------- 1 | # Blog samples 2 | These samples and snippets are referenced in the [Bot Framework blog](http://blog.botframework.com). -------------------------------------------------------------------------------- /blog-samples/images/app-insights-metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/app-insights-metrics.png -------------------------------------------------------------------------------- /blog-samples/images/bot-channels-ngrok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/bot-channels-ngrok.png -------------------------------------------------------------------------------- /blog-samples/images/direct-line-secret-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/direct-line-secret-url.png -------------------------------------------------------------------------------- /blog-samples/images/ngrok-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/ngrok-forward.png -------------------------------------------------------------------------------- /blog-samples/images/qna-portal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/qna-portal.png -------------------------------------------------------------------------------- /blog-samples/images/qna-rich-cards.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/qna-rich-cards.png -------------------------------------------------------------------------------- /blog-samples/images/redux-abs-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/redux-abs-logo.png -------------------------------------------------------------------------------- /blog-samples/images/redux-bot-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/redux-bot-02.png -------------------------------------------------------------------------------- /blog-samples/images/redux-store-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/redux-store-02.png -------------------------------------------------------------------------------- /blog-samples/images/suggested-actions-feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/blog-samples/images/suggested-actions-feedback.png -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/Simple-LUIS-Notes-Sample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.12 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NotesBot", "Simple-LUIS-Notes-Sample\NotesBot.csproj", "{A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A8BA1066-5695-4D71-ABB4-65E5A5E0C3D4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9B625B7D-68FE-4DC9-804E-D483514FE7BC} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/Simple-LUIS-Notes-Sample/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="NotesBot01.WebApiApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/Simple-LUIS-Notes-Sample/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Routing; 7 | 8 | namespace NotesBot01 9 | { 10 | public class WebApiApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | GlobalConfiguration.Configure(WebApiConfig.Register); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/Simple-LUIS-Notes-Sample/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/Simple-LUIS-Notes-Sample/default.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 |

NotesBot01

9 |

Describe your bot here and your terms of use etc.

10 |

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to

https://your_bots_hostname/api/messages

11 | 12 | 13 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/Simple-LUIS-Notes-Sample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/VSIX/BotBuilderVSIX_V3.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/CSharp/Simple-LUIS-Notes-Sample/VSIX/BotBuilderVSIX_V3.zip -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/VSIX/readme.md: -------------------------------------------------------------------------------- 1 | NOTE: This is the older version of the VSIX template. With the release of SDK v4, please use the latest VSIX available on [Visual Studio Market Place](https://marketplace.visualstudio.com/items?itemName=BotBuilder.BotBuilderV4). 2 | -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/images/bot-builder-dotnet-luis-message-flow-bot-code-notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/CSharp/Simple-LUIS-Notes-Sample/images/bot-builder-dotnet-luis-message-flow-bot-code-notes.png -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/images/dotnet-notes-sample-emulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/CSharp/Simple-LUIS-Notes-Sample/images/dotnet-notes-sample-emulator.png -------------------------------------------------------------------------------- /docs-samples/CSharp/Simple-LUIS-Notes-Sample/images/notes-sample-emulator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/CSharp/Simple-LUIS-Notes-Sample/images/notes-sample-emulator.png -------------------------------------------------------------------------------- /docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-luis-message-flow-bot-code-notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-luis-message-flow-bot-code-notes.png -------------------------------------------------------------------------------- /docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-use-luis-create-note-interruption.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-use-luis-create-note-interruption.png -------------------------------------------------------------------------------- /docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-use-luis-create-note-output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-use-luis-create-note-output.png -------------------------------------------------------------------------------- /docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-use-luis-read-note-output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/Node/basics-naturalLanguage/images/bot-builder-nodejs-use-luis-read-note-output.png -------------------------------------------------------------------------------- /docs-samples/README.md: -------------------------------------------------------------------------------- 1 | # Documentation samples 2 | These samples and code snippets are referenced in the [Bot Framework documentation](https://docs.microsoft.com/bot-framework). -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${workspaceFolder}\\lib\\luisbot.js", 12 | "outFiles": [ 13 | "${workspaceFolder}/**/*.js" 14 | ], 15 | "envFile": "${workspaceFolder}\\src\\.env" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/graphics/run-bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/V4/JS/contosocafebot-luis-dialogs/graphics/run-bot.png -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/lib/CafeLUISModel.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Code generated by LUISGen Assets\LU\models\LUIS\cafeLUISModel.json -ts CafeLUISModel -o Assets\LU\models\LUIS 4 | * Tool github: https://github.com/microsoft/botbuilder-tools 5 | * Changes may cause incorrect behavior and will be lost if the code is 6 | * regenerated. 7 | * 8 | */ 9 | import { DateTimeSpec, IntentData, InstanceData } from 'botbuilder-ai'; 10 | export interface _Intents { 11 | Book_Table: IntentData; 12 | Greeting: IntentData; 13 | None: IntentData; 14 | Who_are_you_intent: IntentData; 15 | } 16 | export interface _Instance { 17 | partySize?: InstanceData[]; 18 | datetime?: InstanceData[]; 19 | number?: InstanceData[]; 20 | cafeLocation?: InstanceData[]; 21 | } 22 | export interface _Entities { 23 | partySize?: string[]; 24 | datetime?: DateTimeSpec[]; 25 | number?: number[]; 26 | cafeLocation?: string[][]; 27 | $instance: _Instance; 28 | } 29 | export interface CafeLUISModel { 30 | text: string; 31 | alteredText?: string; 32 | intents: _Intents; 33 | entities: _Entities; 34 | [propName: string]: any; 35 | } 36 | -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/lib/CafeLUISModel.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | ; 4 | //# sourceMappingURL=CafeLUISModel.js.map -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/lib/CafeLUISModel.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"CafeLUISModel.js","sourceRoot":"","sources":["../src/CafeLUISModel.ts"],"names":[],"mappings":";;AAeC,CAAC"} -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/lib/luisbot.d.ts: -------------------------------------------------------------------------------- 1 | export {}; 2 | -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dialogs-luisbot-ts", 3 | "version": "1.0.0", 4 | "description": "Bot Builder example showing a simple bot that uses dialogs to echo anything you say.", 5 | "main": "./lib/luisbot.js", 6 | "scripts": { 7 | "build-sample": "tsc", 8 | "start": "tsc && node ./lib/luisbot.js" 9 | }, 10 | "author": "", 11 | "license": "MIT", 12 | "dependencies": { 13 | "@types/node": "^9.3.0", 14 | "@types/restify": "^5.0.8", 15 | "@microsoft/recognizers-text-data-types-timex-expression": "^1.0.1", 16 | "botbuilder": "^4.0.0-preview1.2", 17 | "botbuilder-ai": "^4.0.0-preview1.2", 18 | "botbuilder-core": "^4.0.0-preview1.2", 19 | "botbuilder-dialogs": "^4.0.0-preview1.2", 20 | "node": "^10.4.0", 21 | "restify": "^6.4.0" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/src/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${file}", 12 | "outFiles": [ 13 | "${workspaceFolder}/**/*.js" 14 | ], 15 | "envFile": "../.env" 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /docs-samples/V4/JS/contosocafebot-luis-dialogs/src/CafeLUISModel.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Code generated by LUISGen Assets\LU\models\LUIS\cafeLUISModel.json -ts CafeLUISModel -o Assets\LU\models\LUIS 4 | * Tool github: https://github.com/microsoft/botbuilder-tools 5 | * Changes may cause incorrect behavior and will be lost if the code is 6 | * regenerated. 7 | * 8 | */ 9 | import {DateTimeSpec, IntentData, InstanceData, NumberWithUnits} from 'botbuilder-ai'; 10 | 11 | export interface _Intents { 12 | Book_Table: IntentData; 13 | Greeting: IntentData; 14 | None: IntentData; 15 | Who_are_you_intent: IntentData; 16 | }; 17 | 18 | export interface _Instance { 19 | partySize?: InstanceData[]; 20 | datetime?: InstanceData[]; 21 | number?: InstanceData[]; 22 | cafeLocation?: InstanceData[]; 23 | } 24 | 25 | export interface _Entities { 26 | // Simple entities 27 | partySize?: string[]; 28 | 29 | // Built-in entities 30 | datetime?: DateTimeSpec[]; 31 | number?: number[]; 32 | 33 | // Lists 34 | cafeLocation?: string[][]; 35 | $instance : _Instance; 36 | } 37 | 38 | export interface CafeLUISModel { 39 | text: string; 40 | alteredText?: string; 41 | intents: _Intents; 42 | entities: _Entities; 43 | [propName: string]: any; 44 | } 45 | -------------------------------------------------------------------------------- /docs-samples/web-chat-speech/webchat-sample-speech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/docs-samples/web-chat-speech/webchat-sample-speech.png -------------------------------------------------------------------------------- /swagger/StateAPI.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/BotFramework-BlogSamples/234f3fb2e445b8e7f77c0cfdfaab6e559c67d945/swagger/StateAPI.json --------------------------------------------------------------------------------