Skip to content

An asynchronous Discord API wrapper for .NET.

License

Notifications You must be signed in to change notification settings

QuantumToasted/Disqord

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disqord

An asynchronous Discord API wrapper for .NET 5 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

AppVeyor NuGet MyGet Discord

Documentation

Documentation is available here.

Installation

Nightly Disqord builds can be pulled as NuGet packages from the MyGet feed: https://www.myget.org/F/disqord/api/v3/index.json.

Minimal Example

Typing ?ping or @YourBot ping in a channel will make the bot respond with Pong!.

using Disqord.Bot;
using Disqord.Bot.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Qmmands;

await new HostBuilder()
    .ConfigureAppConfiguration(x =>
    {
        // We will use the environment variable DISQORD_TOKEN for the bot token.
        x.AddEnvironmentVariables("DISQORD_");
    })
    .ConfigureLogging(x =>
    {
        x.AddSimpleConsole();
    })
    .ConfigureDiscordBot((context, bot) =>
    {
        bot.Token = context.Configuration["TOKEN"];
        bot.Prefixes = new[] { "?" };
    })
    .RunConsoleAsync();

public class ExampleModule : DiscordModuleBase
{
    [Command("ping")]
    public DiscordCommandResult Ping()
        => Response("Pong!");
}

About

An asynchronous Discord API wrapper for .NET.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%