Skip to content

Latest commit

 

History

History
59 lines (52 loc) · 2.61 KB

README.md

File metadata and controls

59 lines (52 loc) · 2.61 KB

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 NuGet MyGet Discord

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