Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Latest commit

 

History

History
37 lines (27 loc) · 1.19 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.19 KB

nyxx_pagination

Pagination addon for nyxx. Allows sending paginated and interactive content via message using discord interactions. Also contains legacy paginator based on emojis.

Usage

Package includes pre-made classes ready to use and also has interfaces to implement everything by yourself.

Example using embed as pagination pages:

FutureOr<void> paginationExampleInteraction(InteractionEvent event) {
  final paginator = EmbedComponentPagination(event.interactions, [
    EmbedBuilder()..description = "This is first page",
    EmbedBuilder()..description = "This is second page",
  ]);

  event.respond(paginator.initMessageBuilder());
}

void main() {
  final bot = Nyxx("<TOKEN>", GatewayIntents.allUnprivileged);

  final interaction = Interactions(bot)
    ..registerSlashCommand(SlashCommandBuilder("paginated", "This is pagination example", [], guild: 302360552993456135.toSnowflake())
      ..registerHandler(paginationExampleInteraction))
    ..syncOnReady();
}

Features and bugs

Please file feature requests and bugs at the issue tracker.