Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/Quahu/Disqord

Asynchronous Discord API wrapper and bot framework for .NET.
https://github.com/Quahu/Disqord

asynchronous bot-framework csharp csharp-library discord discord-api discord-api-wrapper discord-bot discord-bot-framework discord-library disqord dotnet dotnet-core

Last synced: about 2 months ago
JSON representation

Asynchronous Discord API wrapper and bot framework for .NET.

Lists

README

        


Disqord


An asynchronous Discord API wrapper for .NET that aims to make Discord bot development simple and enjoyable without needless boilerplate.




  • Designed around Microsoft's dependency injection abstractions


  • Integrates seamlessly with the Generic Host


  • Replaceable components, stateless REST, customizable caching, and more



[![Workflow](https://img.shields.io/github/actions/workflow/status/Quahu/Disqord/myget.yml?branch=master&style=flat-square&label=Workflow&logo=github)](https://github.com/Quahu/Disqord/actions/workflows/nightly.yml?branch=master)
[![NuGet](https://img.shields.io/nuget/v/Disqord.svg?style=flat-square&label=NuGet&logo=nuget&color=blue)](https://www.nuget.org/packages/Disqord/)
[![MyGet](https://img.shields.io/myget/disqord/vpre/Disqord.svg?style=flat-square&label=MyGet&logo=nuget&color=darkorchid)](https://www.myget.org/feed/disqord/package/nuget/Disqord)
[![Discord](https://img.shields.io/discord/416256456505950215.svg?style=flat-square&label=Discord&logo=discord&color=738ADB)](https://discord.gg/eUMSXGZ)

## Installation
Stable builds are available on NuGet.
Nightly Disqord builds can be pulled as NuGet packages from the MyGet feed: `https://www.myget.org/F/disqord/api/v3/index.json`.

## Documentation
The Disqord documentation is available on [GitHub Pages](https://quahu.github.io/Disqord/).

## Examples
Explore examples of the library in the [/examples](https://github.com/Quahu/Disqord/tree/master/examples) folder, all of which are licensed under the MIT license.

## Minimal Example
Typing `?ping` or `@YourBot ping` in a channel will make the bot respond with `Pong!`.
```cs
using Disqord.Bot.Commands.Text;
using Disqord.Bot.Hosting;
using Microsoft.Extensions.Hosting;
using Qmmands;
using Qmmands.Text;

await Host.CreateDefaultBuilder()
.ConfigureDiscordBot((context, bot) =>
{
// We will use the configuration variable DISQORD_TOKEN for the bot token.
bot.Token = context.Configuration["DISQORD_TOKEN"];
bot.Prefixes = new[] { "?" };
})
.RunConsoleAsync();

public class ExampleModule : DiscordTextModuleBase
{
[TextCommand("ping")]
public IResult Ping()
{
return Response("Pong!");
}
}
```