Meet Justine. 👩
A personal (and Open Source) bot for Discord written in C# using the Discord .NET library. ✌️
I started making this bot for the management of my C# bot-making help server. 👻
My instance of Justine is hosted on a Raspberry Pi 3B running Windows 10 IoT. 💾
The following instructions describe a step by step process of getting Justine on your local machine and ready for development.
If you're interested in hosting your own instance of Justine, check the notes in deployment.
- The recommended IDE is Visual Studio Code.
- You will also need the .NET Core framework.
Getting the source
If you would like to contribute:
- Fork the repository.
- Navigate to your fork.
- Clone your fork to your local machine.
If you just want a copy of the code:
- Directly Clone or download as a ZIP of this repository. 🙌
Setting up the development environment
-
The solution file can be found at
./src/Justine.sln
, it links to the two.csproj
files:Justine.csproj
andJustine.NUnit.Tests.csproj
for unit tests. -
It is recommended to open the root directory in your IDE.
-
After that, you should be ready to develop.
To run Unit Tests in Visual Studio Code, you use the CTRL + SHIFT + P
shortcut to open the command palette where you can invoke the Tasks: Run Test Task
command.
ℹ️ Justine comes with .vscode/tasks.json
file which is used by Visual Studio Code to setup the default Build and Test tasks. After selecting the Tasks: Run Test Task
command, you should be able to select the predefined test
task.
If you don't see the test task, make sure you opened the root folder in Visual Studio Code.
Alternatively, you can navigate to the src/
directory in through command prompt and run the following command:
dotnet test ./Justine.NUnit.Tests/Justine.NUnit.Tests.csproj /p:CollectCoverage=true /p:Include=[Justine]* /p:Exclude=\"[Justine]Justine.Discord.*,[Justine]Justine.Program,[NUnit3.TestAdapter]*\" /p:CoverletOutputFormat=opencover /p:Threshold=100 /p:ThresholdType=line
This command will run the Unit Tests as well as generate the code coverage report.
*Note that Unit Tests will fail if your code coverage is bellow 100%.
To publish a version of Justine and run it on a machine, you can use this tutorial that walks you through the process.
- When running the application for the first time, a notice about an invalid token might appear. If this happens, close the application, check its directory and search for
App.xml
(can beJustine.dll.xml
). Edit this file and make sure to put your token in the right place. The next launch of the application should properly connect.
Justine is using SQLlite for her data storage and requires a Justine.db
file with a specific setup. You can find an example Justine.db
file in the ./src/Justine.NUnit.Tests/
folder. This database is used for testing and contains minor dummy entries.
Release versions of Justine contain an empty and ready-to-go database in their ZIP file.
- .NET Core 2.0 - Platform used
- Discord .NET - Discord API wrapper library
- NUnit - Testing Framework
- Lamar - Inversion of Control container
- MS Entity Framework Core - Microsoft's Entity Framework solution
- ❤️ Passion and a healthy bit of self-interest 😋
Hey, thank you so much for trying to contribute! It is super nice of you! 💕
This is just my personal playground, feel free to learn from it, but if you want to contribute, check out Miunie The Community Bot. 💛
ℹ️ Though if you super want to help out, I will be only glad to see your pull requests. =)
- Petr Sedláček - Developer - PetrSpelos
This project is licensed under the MIT License - see the LICENSE.md file for details