In order to run and test the Discord bot, we first need to initialize the database. The we will first need to create the appsettings.json file.
After cloning the P1-CSharp-Bot repository, you should have a copy of a folder called HowToGetStarted as well. In this folder there are three JSON files:
These files have the format to use for the appsettings.json file in the corresponding folder. Make a copy of each file and move them to their respective folders located in the Discord Bot folder.
This is the simplest of the settings files. All you need for this file is the connection string for the SQL database you will be using. The default connection, which can be found in the WebApp settings file, is this:
"ConnectionString": "Server=localhost; Port=3306; Database=botdb; Uid=root;"
Once you have finished formatting the appsettings.json files, please go to the root folder of `P1-CSharp-Bot` in your local machine and run the following command in the terminal of your choice:
dotnet ef database update --project "Discord Bot/Models"