Disqord

Asynchronous Discord API wrapper and bot framework for .NET.

LGPL-3.0 License

Stars
163
Committers
17

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.

Examples

Explore examples of the library in the /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!.

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!");
    }
}