This can be used as a starter template for a .net bot with the latest patterns and practices.
At this time, there is no NodeJS equivalent (but that would make a great pull request).
There is an official template for Bot Framework v4.5.0 which you can see here: https://marketplace.visualstudio.com/items?itemName=BotBuilder.botbuilderv4
The official template provides three starter options which may or may not be useful. The Core bot
is the most comprehensive and complete.
This sample is complimentary to the official template and Bot Framework Samples. Many of the patterns used in this sample are taken from common patterns seen in these official samples.
This sample includes the following:
- Bot project with v4.5.0
Microsoft.Bot.Builder.*
NuGet packages - Up-to-date patterns around
StartUp.cs
,Program.cs
,BotController.cs
, the mainActivityHandler
architecture anddialog
constrctors - Basic dialog system with a root dialog and multiple child dialogs
- Global state being updated and used accross
ActivityHandler
andDialog
s - Passing objects to dialogs on construction
- Strings using RESX files
- A placeholder (commented out) example of using Dispatch, Luis and QNAMaker
There are multiple ways you can use this project.
There is a Visual Studio 2019 template based on the contents of the src
folder in this repository.
To use the VSIX, follow these steps (steps optimized for Visual Studio 2019)
- Download
StarterBot.vsix
from here - Install
StarterBot.vsix
- Launch Visual Studio 2019
Create new project
- Search for "starterbot"
- Select the
StarterBot
template - Set a
Project name
,Location
andSolution name
as required andCreate
This is only compatible with Visual Studio 2019. If you have Visual Studio 2017, see the 'Clone and rename' section.
This is the simplest way to use this template, but may not always be up-to-date because the VSIX needs to be manually built and is not automated on every commit. If you want to be sure to have the latest version, please see the 'Clone and rename' section.
You can see the VSIX project itself at /vsix/src.
You can clone this repository and adapt to suit your needs.
This approach is appropriate if you want the very latest version of the template or simply want to explore the code without creating a new project.
Follow these steps:
- Clone this repository
- Rename the /src/StarterBot.sln solution in Visual Studio
- Rename the /src/StarterBot.csproj project in Visual Studio
- Set your new namespace in the project settings
- Find and replace all instances of
namespace StarterBot
with your new namespace - Replace all instances of
StarterBot
in the resource files (SharedStrings.resx
,CountryStrings.resx
,NameAgeStrings.resx
andRootStrings.resx
) with your new namespace by simple re-saving the resource files
This was a collaborative effort between these main contributors: