J4asper.DSharpPlus.BetterPagination 1.0.1

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

// Install J4asper.DSharpPlus.BetterPagination as a Cake Tool
#tool nuget:?package=J4asper.DSharpPlus.BetterPagination&version=1.0.1                

BetterPagination

This NuGet package provides an enhanced pagination experience for DSharpPlus, offering a better visual interface for navigating between paginated content.

NuGet Version

Installation

NuGet

To install the package, open the terminal in your project and run the following command, replacing 1.0.0 with the latest version:

dotnet add package J4asper.DSharpPlus.BetterPagination --version 1.0.0

Alternatively, you can search for J4asper.DSharpPlus.BetterPagination in your IDE’s NuGet Package Manager.

From Source

To build the package from source, follow these steps:

  1. Clone the repository:

    git clone https://github.com/j4asper/DSharpPlus.BetterPagination.git
    
    
  2. In your project’s .csproj file, add the following reference:

    <ProjectReference Include="../DSharpPlus.BetterPagination/DSharpPlus.BetterPagination/DSharpPlus.BetterPagination.csproj" />
    
    

Documentation

This package adds an extension method, SendBetterPaginatedMessageAsync, to the SlashCommandContext class, enabling easy pagination in your bot commands.

Example Usage

Here’s an example of how to use the package to send a paginated message within a command:

[Command("example")]
[Description("This is a paginated example command")]
public async ValueTask PaginatedExampleCommand(SlashCommandContext context)
{
    var embedPageOne = new DiscordEmbedBuilder()
        .WithDefaultColor()
        .WithContent("This is page 1");

    var embedPageTwo = new DiscordEmbedBuilder()
        .WithDefaultColor()
        .WithContent("This is page 2");

    List<Page> pages = new()
    {
        new Page { Embed = embedPageOne },
        new Page { Embed = embedPageTwo }
    };

    // Send the paginated message
    await context.SendBetterPaginatedMessageAsync(pages);
}

In this example:

  • Two pages are created using DiscordEmbedBuilder, each with different content.
  • These pages are added to a List<Page>, which is passed to the SendBetterPaginatedMessageAsync method to send a paginated message.
  • Users can navigate between pages using the forward and back buttons that are automatically added to the message.
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
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
1.0.4 69 11/27/2024
1.0.3 42 11/26/2024
1.0.2 45 11/26/2024
1.0.1 49 11/26/2024
1.0.0 46 11/26/2024