Discord.Net.Labs 2.4.0

Suggested Alternatives

Discord.Net

There is a newer version of this package available.
See the version list below for details.
dotnet add package Discord.Net.Labs --version 2.4.0
                    
NuGet\Install-Package Discord.Net.Labs -Version 2.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Discord.Net.Labs" Version="2.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Discord.Net.Labs" Version="2.4.0" />
                    
Directory.Packages.props
<PackageReference Include="Discord.Net.Labs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Discord.Net.Labs --version 2.4.0
                    
#r "nuget: Discord.Net.Labs, 2.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Discord.Net.Labs&version=2.4.0
                    
Install as a Cake Addin
#tool nuget:?package=Discord.Net.Labs&version=2.4.0
                    
Install as a Cake Tool

Discord.Net Labs

NuGet

Join our Discord server for support using labs

This repo is a custom fork of Discord.Net that introduces the newest features of discord for testing and experimenting. Nothing here is guaranteed to work but you are more than welcome to submit bugs in the issues tabs

Known issues

Labs will not work with Playwo's InteractivityAddon. The reason is that his package depends on the base discord.net lib, you can get around this by cloning his repo and building it with discord.net labs instead of discord.net.

How to use

Setting up labs in your project is really simple, here's how to do it:

  1. Remove Discord.Net from your project
  2. Add Discord.Net Labs nuget to your project
  3. Enjoy!

Branches

Dev

The main branch we pull off of to introduce new features into, the dev branch is the same as Discord.Nets dev branch

Interactions

This branch is for anything todo with Discord Interactions, such as Slash commands and Message Components. This branch is stable enough to use but does not contain all the features of interactions.

SlashCommandService

This branch is on pause and does not work currently, Once everything is stable with the Interaction branch we will continue working on a slash command service for it.

web/SlashCommandService

webmilio's spin on the SlashCommandService branch, again the state of this is unknown.

Message Components

So, you want to use Message components? Well you're in luck! Below is a quick overview of how to use them

Listening for button presses
// Subscribe to the InteractionCreated event
client.InteractionCreated += Client_InteractionCreated;

...
private async Task Client_InteractionCreated(SocketInteraction arg)
{
  // If the type of the interaction is a message component
  if(arg.Type == Discord.InteractionType.MessageComponent)
  {
    // parse the args 
    var parsedArg = (SocketMessageComponent)arg;
    // respond with the update message response type. This edits the original message if you have set AlwaysAcknowledgeInteractions to false.
    await parsedArg.RespondAsync($"Clicked {parsedArg.Data.CustomId}!", type: InteractionResponseType.UpdateMessage);
  }
}
Sending messages with buttons

Theres a new field in all SendMessageAsync functions that takes in a MessageComponent, you can use it like so:

var builder = new ComponentBuilder().WithButton("Hello!", ButtonStyle.Primary, customId: "id_1");
await Context.Channel.SendMessageAsync("Test buttons!", component: builder.Build());

Slash commands

Slash command example how to's can be found here. If you want to read some code using slash commands, you can do that here

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Discord.Net.Labs:

Package Downloads
Discord.KillersLibrary.Labs

This package is an Addon for Discord.Net It provides embedding pages and multi buttons for your Discord Bot. Moreover it includes support for any command framework and slash commands.

Xssp.Discord.Util

Provides various utilities to simplify the use of the Discord.NET API.

DNetLabRat

Button lib for Discord.Net-Labs

Discord.Killer

This package is an Addon for Discord.Net. It provides enbeding pages for your Discord Bot. Moreover it includes support for any command framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.6.1 24,235 12/24/2021 3.6.1 is deprecated because it is no longer maintained.
3.6.0 650 12/24/2021 3.6.0 is deprecated because it is no longer maintained.
3.5.0 1,573 12/15/2021 3.5.0 is deprecated because it is no longer maintained.
3.4.9 3,386 12/6/2021 3.4.9 is deprecated because it is no longer maintained.
3.4.8 5,287 12/4/2021 3.4.8 is deprecated because it is no longer maintained.
3.4.7 2,899 11/28/2021 3.4.7 is deprecated because it is no longer maintained.
3.4.6 772 11/27/2021 3.4.6 is deprecated because it is no longer maintained.
3.4.5 624 11/27/2021 3.4.5 is deprecated because it is no longer maintained.
3.4.4 664 11/27/2021 3.4.4 is deprecated because it is no longer maintained.
3.4.3 660 11/27/2021 3.4.3 is deprecated because it is no longer maintained.
3.4.2 2,425 11/26/2021 3.4.2 is deprecated because it is no longer maintained.
3.4.1 1,940 11/26/2021 3.4.1 is deprecated because it is no longer maintained.
3.4.0 2,015 11/26/2021 3.4.0 is deprecated because it is no longer maintained.
3.3.3 882 11/23/2021 3.3.3 is deprecated because it is no longer maintained.
3.3.2 1,171 11/21/2021 3.3.2 is deprecated because it is no longer maintained.
3.3.1 1,314 11/21/2021 3.3.1 is deprecated because it is no longer maintained.
3.3.0 1,561 11/19/2021 3.3.0 is deprecated because it is no longer maintained.
3.2.0 1,825 11/9/2021 3.2.0 is deprecated because it is no longer maintained.
3.1.7 3,613 10/20/2021 3.1.7 is deprecated because it is no longer maintained.
3.1.6 1,526 10/15/2021 3.1.6 is deprecated because it is no longer maintained.
3.1.5 763 10/15/2021 3.1.5 is deprecated because it is no longer maintained.
3.1.4 959 10/13/2021 3.1.4 is deprecated because it is no longer maintained.
3.1.3 1,159 10/12/2021 3.1.3 is deprecated because it is no longer maintained.
3.1.2 804 10/12/2021 3.1.2 is deprecated because it is no longer maintained.
3.1.1 3,330 9/23/2021 3.1.1 is deprecated because it is no longer maintained.
3.1.0 887 9/21/2021 3.1.0 is deprecated because it is no longer maintained.
3.0.4 1,310 9/15/2021 3.0.4 is deprecated because it is no longer maintained.
3.0.3 3,397 9/13/2021 3.0.3 is deprecated because it is no longer maintained.
3.0.2 3,648 8/25/2021 3.0.2 is deprecated because it is no longer maintained.
3.0.2-pre 841 8/8/2021 3.0.2-pre is deprecated because it is no longer maintained.
3.0.1 667 8/25/2021 3.0.1 is deprecated because it is no longer maintained.
3.0.1-pre 483 8/5/2021 3.0.1-pre is deprecated because it is no longer maintained.
3.0.0 792 8/24/2021 3.0.0 is deprecated because it is no longer maintained.
3.0.0-pre 353 8/5/2021 3.0.0-pre is deprecated because it is no longer maintained.
2.4.9 1,719 7/17/2021 2.4.9 is deprecated because it is no longer maintained.
2.4.8 771 7/15/2021 2.4.8 is deprecated because it is no longer maintained.
2.4.7 951 7/11/2021 2.4.7 is deprecated because it is no longer maintained.
2.4.6 848 7/11/2021 2.4.6 is deprecated because it is no longer maintained.
2.4.5 750 7/7/2021 2.4.5 is deprecated because it is no longer maintained.
2.4.4 773 7/6/2021 2.4.4 is deprecated because it is no longer maintained.
2.4.3 739 7/5/2021 2.4.3 is deprecated because it is no longer maintained.
2.4.2 752 7/4/2021 2.4.2 is deprecated because it is no longer maintained.
2.4.1 774 7/3/2021 2.4.1 is deprecated because it is no longer maintained.
2.4.0 761 7/3/2021 2.4.0 is deprecated because it is no longer maintained.
2.3.8-dev 442 7/2/2021 2.3.8-dev is deprecated because it is no longer maintained.
2.3.7 1,295 5/30/2021 2.3.7 is deprecated because it is no longer maintained.
2.3.6 827 5/30/2021 2.3.6 is deprecated because it is no longer maintained.
2.3.5 804 5/30/2021 2.3.5 is deprecated because it is no longer maintained.
2.3.4 756 5/29/2021 2.3.4 is deprecated because it is no longer maintained.
2.3.3 743 5/28/2021 2.3.3 is deprecated because it is no longer maintained.
2.3.2 687 5/28/2021 2.3.2 is deprecated because it is no longer maintained.
2.3.1 765 5/27/2021 2.3.1 is deprecated because it is no longer maintained.