NetCord.Services
1.0.0-alpha.221
Prefix Reserved
See the version list below for details.
dotnet add package NetCord.Services --version 1.0.0-alpha.221
NuGet\Install-Package NetCord.Services -Version 1.0.0-alpha.221
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.221" />
paket add NetCord.Services --version 1.0.0-alpha.221
#r "nuget: NetCord.Services, 1.0.0-alpha.221"
// Install NetCord.Services as a Cake Addin #addin nuget:?package=NetCord.Services&version=1.0.0-alpha.221&prerelease // Install NetCord.Services as a Cake Tool #tool nuget:?package=NetCord.Services&version=1.0.0-alpha.221&prerelease
The modern and fully customizable C# Discord library
Table of Contents
- 📦 Installation
- 🚀 Showcase
- 🎨 Features
- 🥅 Goals
- 📚 Guides
- 📄 Documentation
- 🩹 Support
- 📜 License
1. 📦 Installation
You can install NetCord packages via NuGet package manager:
Package | Description |
---|---|
NetCord | Core package with fundamental functionality. |
NetCord.Services | Facilitates seamless handling of commands and interactions. |
NetCord.Hosting | Provides .NET Generic Host extensions for the NetCord package. |
NetCord.Hosting.Services | Provides .NET Generic Host extensions for the NetCord.Services package. |
NetCord.Hosting.AspNetCore | Provides ASP.NET Core extensions for seamless handling of HTTP interactions. |
2. 🚀 Showcase
This snippet showcases a bot with a minimal API-style /square
command and includes a module-based /greet
command.
Minimal API-style Bot Example
The following example sets up a bot with a minimal API-style approach for the /square
command, which calculates the square of a number:
var builder = Host.CreateDefaultBuilder(args)
.UseDiscordGateway()
.UseApplicationCommands<SlashCommandInteraction, SlashCommandContext>();
var host = builder.Build()
.AddSlashCommand<SlashCommandContext>("square", "Square!", (int a) => $"{a}² = {a * a}")
.UseGatewayEventHandlers();
await host.RunAsync();
Module-based Command Example
Moreover, you can use a module-based approach. Here's an example of a /greet
command that greets a specified user:
public class GreetingModule : ApplicationCommandModule<SlashCommandContext>
{
[SlashCommand("greet", "Greet someone!")]
public string Greet(User user) => $"{Context.User} greets {user}!";
}
3. 🎨 Features
- Fully customizable - NetCord is fully customizable and extensible
- Easy to use - NetCord is easy to use and understand
- Lightweight - NetCord is lightweight and performant
- Asynchronous - NetCord is fully asynchronous and concurrent
- AOT-ready - NetCord supports Native AOT compilation
- Immutable - NetCord's caching is immutable by default
- Voice-ready - NetCord supports both sending and receiving voice
- Comprehensive - NetCord covers the entire Discord API and more
4. 🥅 Goals
NetCord's goal is to allow .NET developers to create fully customizable Discord bots without fighting the API wrapper itself. NetCord is designed to be easy to use and fully customizable, while still being lightweight and performant.
5. 📚 Guides
6. 📄 Documentation
7. 🩹 Support
8. 📜 License
This repository is released under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- NetCord (>= 1.0.0-alpha.320)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on NetCord.Services:
Package | Downloads |
---|---|
NetCord.Hosting.Services
The modern and fully customizable C# Discord library. |
|
NetCordAddons.Services
Unofficial netcord addons for better adding services using hosting. |
|
Lavalink4NET.NetCord
High performance Lavalink wrapper for .NET | Add powerful audio playback to your NetCord-based applications with this integration for Lavalink4NET. Suitable for end users developing with NetCord. |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on NetCord.Services:
Repository | Stars |
---|---|
angelobreuer/Lavalink4NET
Lavalink4NET is a Lavalink wrapper with node clustering, caching and custom players for .NET with support for Discord.Net, DSharpPlus, Remora, and NetCord.
|