Pagination class
A plugin that adds support for pagination to nyxx clients.
This plugin must be registered to all clients making use of the pagination features.
Constructors
- Pagination(PaginationOptions options)
- Create a new Pagination instance.
Properties
-
clientType
→ RuntimeType<
NyxxGateway> -
The type of client this plugin requires.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → Logger
-
A logger that can be used to log messages from this plugin.
no setterinherited
- name → String
-
The name of this plugin.
no setter
-
onDisallowedUse
→ Stream<
InteractionCreateEvent< MessageComponentInteraction> > -
A stream of interactions that were recognized by this plugin but were not handled because the wrong user triggered the interaction.
no setter
-
onUnhandledInteraction
→ Stream<
InteractionCreateEvent< MessageComponentInteraction> > -
A stream of interactions that were recognized as being created by a Pagination plugin different to this one.
no setter
- options → PaginationOptions
-
The default options to use for all paginated messages.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
afterClose(
) → FutureOr< void> -
Called after each client this plugin is added to closes.
inherited
-
afterConnect(
NyxxGateway client) → void - Called after each client this plugin is added to connects.
-
beforeClose(
NyxxGateway client) → Future< void> - Called before each client this plugin is added to closes.
-
beforeConnect(
ApiOptions apiOptions, ClientOptions clientOptions) → FutureOr< void> -
Called before each client this plugin is added to connects.
inherited
-
builders(
List< MessageBuilder> builders, {PaginationOptions? options, int startIndex = 0, Snowflake? userId}) → Future<MessageBuilder> -
Create a
MessageBuilder
for a paginated message created from a list ofMessageBuilder
s. -
createState(
) → FutureOr< NyxxPluginState< NyxxGateway, NyxxPlugin< >NyxxGateway> > -
Called to create the state for this plugin.
inherited
-
doClose(
NyxxGateway client, Future< void> close()) → Future<void> -
Perform the close operation.
inherited
-
doConnect(
ApiOptions apiOptions, ClientOptions clientOptions, Future< NyxxGateway> connect()) → Future<NyxxGateway> -
Perform the connection operation.
inherited
-
factories(
List< FutureOr< builders, {PaginationOptions? options, int startIndex = 0, Snowflake? userId}) → Future<MessageBuilder> Function()>MessageBuilder> -
Create a
MessageBuilder
for a paginated message created by a list of builder factories. -
generate(
FutureOr< MessageBuilder> builder(int index), {required int pages, PaginationOptions? options, int startIndex = 0, Snowflake? userId}) → Future<MessageBuilder> -
Create a
MessageBuilder
for a paginated message created by a builder factory. -
interceptGatewayMessages(
Shard shard, Stream< GatewayMessage> messages) → Stream<GatewayMessage> -
Intercept
GatewayMessage
s by transforming themessages
stream.inherited -
interceptRequest(
NyxxGateway client, HttpRequest request, Future< HttpResponse> next(HttpRequest)) → Future<HttpResponse> -
Called whenever a request is made using a client's
HttpHandler
.inherited -
interceptShardMessages(
Shard shard, Stream< ShardMessage> messages) → Stream<ShardMessage> -
Intercept
ShardMessage
s by transforming themessages
stream.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
split(
String content, {Pattern? splitAt, FutureOr< MessageBuilder> buildChunk(String content)?, int maxLength = 2000, PaginationOptions? options, Snowflake? userId}) → Future<MessageBuilder> -
Create a
MessageBuilder
for a paginated message created by splitting a long String into parts. -
splitEmbeds(
String content, {Pattern? splitAt, FutureOr< EmbedBuilder> buildChunk(String content)?, int maxLength = 4096, PaginationOptions? options, Snowflake? userId}) → Future<MessageBuilder> -
Create a
MessageBuilder
for a paginated message created by splitting a long String into parts and placing the resulting text inEmbed
s. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited