Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Latest commit

 

History

History
100 lines (58 loc) · 5.44 KB

README.md

File metadata and controls

100 lines (58 loc) · 5.44 KB

Justine - Discord bot

GitHub license Codacy Badge Build status Coverage Status

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. 💾

Getting Started

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.

Prerequisites

Installation

Getting the source

If you would like to contribute:

  1. Fork the repository.
  2. Navigate to your fork.
  3. Clone your fork to your local machine.

If you just want a copy of the code:

  1. 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 and Justine.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.

Running the tests

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%.

Deployment

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 be Justine.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.

Database

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.

Built With

Contributing

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. =)

Author

License

This project is licensed under the MIT License - see the LICENSE.md file for details