Skip to content

zobweyt/Discord.Net.Template

Repository files navigation

Discord.NET Logo

Discord.Net.Template

A template for building scalable and ready for production Discord.NET apps within the .NET ecosystem.

Dependencies Size Creation Date

📦 Usage

To start, open a command prompt and follow these instructions:

Step 1 — Get the template

Use this repository as a template, open it in your editor, and navigate to the startup project:

cd src/Template

Step 2 — Configure the environment

We are using the options pattern for typed access to groups of related settings. You should configure the appsettings.json file or manage user secrets via CLI:

dotnet user-secrets set <key> <value>

Note

Pending database migrations are applied automatically before startup and an informational message is logged.

Step 3 — Run the app

To run the bot, just execute the following command:

dotnet watch

The initial setup is done. Enjoy using the template! 🎉

Warning

Instead of using the dotnet run in production, create a deployment using the dotnet publish command and deploy the output.

🎨 Customization

Here is what you can also do:

  • Find and replace all occurrences of "template" to fit your app's name.
  • Rewrite the README.md file to fit your needs.
  • Follow the TODO comments across the entire solution.

Tip

Take a look at the discord-md-badge project which is a customizable badge that shows your or a bot account status, or a server invite.

🧪 Testing

This project utilizes the xUnit framework for creating test cases. It also incorporates Moq for mocking objects and Bogus to generate fake data.

To run all the tests, execute the following command from the root directory in your command prompt:

dotnet test

🚀 Contributing

To contribute to this project, please read the CONTRIBUTING.md file. It provides details on our code of conduct and the process for submitting pull requests.

❤️ Acknowledgments

See the contributors who participated in this project and the dependencies used.

📜 License

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