https://github.com/zobweyt/discord.net.template
A template for building scalable and ready for production Discord.NET apps within the .NET ecosystem (https://discord.com)
https://github.com/zobweyt/discord.net.template
bogus discord discord-csharp discord-net discord-net-database discord-net-sql discord-net-template dotnet ef-core ef-core-migrations moq sqlite template xunit
Last synced: 3 months ago
JSON representation
A template for building scalable and ready for production Discord.NET apps within the .NET ecosystem (https://discord.com)
- Host: GitHub
- URL: https://github.com/zobweyt/discord.net.template
- Owner: zobweyt
- License: mit
- Created: 2022-08-27T12:55:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-10T18:00:48.000Z (over 1 year ago)
- Last Synced: 2025-03-23T20:02:19.539Z (7 months ago)
- Topics: bogus, discord, discord-csharp, discord-net, discord-net-database, discord-net-sql, discord-net-template, dotnet, ef-core, ef-core-migrations, moq, sqlite, template, xunit
- Language: C#
- Homepage: https://docs.discordnet.dev
- Size: 121 KB
- Stars: 10
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Discord.Net.Template
A template for building scalable and ready for production Discord.NET apps within the .NET ecosystem.
![]()
![]()
![]()
## ๐ฆ Usage
To start, open a command prompt and follow these instructions:
### Step 1 โ Get the template
[Use](https://github.com/zobweyt/Discord.Net.Template/generate) this repository as a [template](https://docs.github.com/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template), open it in your editor, and navigate to the startup project:
```sh
cd src/Template
```### Step 2 โ Configure the environment
We are using the [options pattern](https://learn.microsoft.com/aspnet/core/fundamentals/configuration/options) for typed access to groups of [related settings](./src/Template/Common/Options). You should configure the [`appsettings.json`](./src/Template/appsettings.json) file or manage [user secrets](https://learn.microsoft.com/aspnet/core/security/app-secrets) via [CLI](https://learn.microsoft.com/dotnet/core/tools):
```sh
dotnet user-secrets set
```> [!NOTE]
> Pending database migrations are applied automatically [before startup](./src/Template/Program.cs#L49) and an informational [message](./src/Template/Extensions/HostExtensions.cs#L29) is logged.### Step 3 โ Run the app
To run the bot, just execute the following command:
```sh
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](https://docs.discordnet.dev/guides/deployment/deployment) 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`](README.md) file to fit your needs.
- [ ] Follow the TODO comments across the entire solution.> [!TIP]
> Take a look at the [discord-md-badge](https://github.com/gitlimes/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](https://github.com/xunit/xunit) framework for creating test cases. It also incorporates [Moq](https://github.com/moq/moq) for mocking objects and [Bogus](https://github.com/bchavez/Bogus) to generate fake data.
To run all the [tests](./test), execute the following command from the root directory in your command prompt:
```sh
dotnet test
```## ๐ Contributing
To contribute to this project, please read the [`CONTRIBUTING.md`](.github/CONTRIBUTING.md) file. It provides details on our code of conduct and the process for submitting pull requests.
## โค๏ธ Acknowledgments
See the [contributors](https://github.com/zobweyt/Discord.Net.Template/contributors) who participated in this project and the [dependencies](https://github.com/zobweyt/Discord.Net.Template/network/dependencies) used.
## ๐ License
This project is licensed under the **MIT License** โ see the [`LICENSE.md`](LICENSE.md) file for details.