Discord.InteractivityAddon 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Discord.InteractivityAddon --version 1.3.0
NuGet\Install-Package Discord.InteractivityAddon -Version 1.3.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.InteractivityAddon" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Discord.InteractivityAddon --version 1.3.0
#r "nuget: Discord.InteractivityAddon, 1.3.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.
// Install Discord.InteractivityAddon as a Cake Addin
#addin nuget:?package=Discord.InteractivityAddon&version=1.3.0

// Install Discord.InteractivityAddon as a Cake Tool
#tool nuget:?package=Discord.InteractivityAddon&version=1.3.0

Discord.InteractivityAddon

NuGet BotFacility

This is an addon for the Discord API Wrapper Discord.Net which makes it easy to add interactivity to your discord bot.

Credits

Installation

The package can be pulled easily from NuGet.

Features

  • Waiting for a specific message or reaction using a powerful criteria system
  • Waiting for a message / reaction which passes your criteria
    • Run actions on filtered messages / reactions
  • Send and delete messages & files with delays
  • A powerful fully customizable Paginator
    • Send multi page messages
    • Move through pages using reactions
  • Fully customizable selection from a list of objects
    • Makes user input easy
    • Works via messages or reactions
    • For more customizability you can create your own child of the selection class
  • Confirmation of an action
  • Uptime counter

Usage

To properly use the features this addon provides you need the InteractivityService to your service provider.

var provider = new ServiceCollection()
                .AddSingleton(Client)
                .AddSingleton(CommandService)
                .AddSingleton(new InteractivityService(Client, TimeSpan.FromMinutes(3)))

This addon does not include a custom ModuleBase in order to support every command framework. (Discord.Net.Command/Qmmands/...)

Example Selection Command

[Command("select")]
public async Task ExampleSelectionAsync()
{
    var builder = new ReactionSelectionBuilder<string>()
        .WithValues("Hi", "How", "Hey", "Huh?!")
        .WithEmotes(new Emoji("💵"), new Emoji("🍭"), new Emoji("😩"), new Emoji("💠"))
        .WithUsers(Context.User)
        .WithAppearance(ReactionSelectionAppearanceBuilder.Default.WithDeletion(DeletionOption.AfterCapturedContext);

    var result = await _interactivity.SendSelectionAsync(await builder.Build(), Context.Channel, TimeSpan.FromSeconds(50));

    if (result.IsSuccess == true) {
        await Context.Channel.SendMessageAsync(result.Value.ToString());
    }
}

Example Paginator Command

[Command("paginator")]
public async Task ExamplePaginatorAsync()
{
    var pages = new List<Embed>() {
        new EmbedBuilder().WithTitle("I").Build(),
        new EmbedBuilder().WithTitle("am").Build(),
        new EmbedBuilder().WithTitle("cool").Build(),
        new EmbedBuilder().WithTitle(":sunglasses: ").Build(),
    };

    var paginator = new PaginatorBuilder()
        .WithEmbeds(pages.ToArray())
        .WithUsers(Context.User)
        .WithPaginatorFooter(PaginatorFooter.PageNumber | PaginatorFooter.Users)
        .Build();

    await _interactivity.SendPaginatorAsync(paginator, Context.Channel, TimeSpan.FromMinutes(2));
}

Example Confirmation Command

[Command("confirm")]
public async Task ExampleConfirmationAsync()
{
    var message = await Context.Channel.SendMessageAsync("Please confirm!");
    var request = new ConfirmationRequest(message, Context.User.Id);

    var result = await _interactivity.GetUserConfirmationAsync(request);

    if (result.Value == true) {
        await message.ModifyAsync(x => x.Content = "Confirmed :thumbsup:!");
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.4.1-preview-20212511.1 1,504 11/26/2021
2.4.1-preview-2021092110.1 197 9/10/2021
2.4.1-preview-20210624.1 319 6/23/2021
2.4.1-dev-20210513.1 832 5/13/2021
2.4.0 7,574 5/13/2021
2.4.0-dev-20210512.1 160 5/11/2021
2.4.0-dev-20210320.1 411 3/20/2021
2.4.0-dev-20210307.3 282 3/7/2021
2.1.1 1,000 7/10/2020
2.1.0 527 5/18/2020
2.0.5 521 5/18/2020
2.0.4 531 5/13/2020
2.0.3 580 1/31/2020
2.0.1 675 12/12/2019
2.0.0 564 12/6/2019
1.3.1 633 8/8/2019
1.3.0 683 5/16/2019
1.2.3 640 5/10/2019
1.2.2 639 4/30/2019
1.1.0 651 4/15/2019
0.9.5.1 671 4/8/2019
0.9.0 881 4/4/2019