Table of Contents
API reference

Method SendPaginatedMessageAsync

Namespace
DisCatSharp.Interactivity.Extensions
Assembly
DisCatSharp.Interactivity.dll

SendPaginatedMessageAsync(DiscordChannel, DiscordUser, IEnumerable<Page>, PaginationEmojis, PaginationBehaviour?, PaginationDeletion?, TimeSpan?, CancellationToken)

Sends a new paginated message.

public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable<Page> pages, PaginationEmojis emojis, PaginationBehaviour? behaviour = null, PaginationDeletion? deletion = null, TimeSpan? timeoutOverride = null, CancellationToken cancellationToken = default)

Parameters

channel DiscordChannel

Target channel.

user DiscordUser

The user that will be able to control the pages.

pages IEnumerable<Page>

A collection of Page to display.

emojis PaginationEmojis

Pagination emojis.

behaviour PaginationBehaviour?

Pagination behaviour (when hitting max and min indices).

deletion PaginationDeletion?

Deletion behaviour.

timeoutOverride TimeSpan?

Override timeout period.

cancellationToken CancellationToken

A cancellation token that can be used to cancel the pagination.

Returns

Task

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.

SendPaginatedMessageAsync(DiscordChannel, DiscordUser, IEnumerable<Page>, PaginationButtons, PaginationBehaviour?, ButtonPaginationBehavior?, CancellationToken)

Sends a new paginated message with buttons.

public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable<Page> pages, PaginationButtons buttons, PaginationBehaviour? behaviour = null, ButtonPaginationBehavior? deletion = null, CancellationToken token = default)

Parameters

channel DiscordChannel

Target channel.

user DiscordUser

The user that will be able to control the pages.

pages IEnumerable<Page>

A collection of Page to display.

buttons PaginationButtons

Pagination buttons (leave null to default to ones on configuration).

behaviour PaginationBehaviour?

Pagination behaviour.

deletion ButtonPaginationBehavior?

Deletion behaviour

token CancellationToken

A custom cancellation token that can be cancelled at any point.

Returns

Task

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.

SendPaginatedMessageAsync(DiscordChannel, DiscordUser, IEnumerable<Page>, PaginationBehaviour?, ButtonPaginationBehavior?, CancellationToken)

Sends a new paginated message with buttons.

public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable<Page> pages, PaginationBehaviour? behaviour = null, ButtonPaginationBehavior? deletion = null, CancellationToken token = default)

Parameters

channel DiscordChannel

Target channel.

user DiscordUser

The user that will be able to control the pages.

pages IEnumerable<Page>

A collection of Page to display.

behaviour PaginationBehaviour?

Pagination behaviour.

deletion ButtonPaginationBehavior?

Deletion behaviour

token CancellationToken

A custom cancellation token that can be cancelled at any point.

Returns

Task

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.

SendPaginatedMessageAsync(DiscordChannel, DiscordUser, IEnumerable<Page>, PaginationButtons, TimeSpan?, PaginationBehaviour?, ButtonPaginationBehavior?)

Sends a new paginated message with buttons.

public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable<Page> pages, PaginationButtons buttons, TimeSpan? timeoutOverride, PaginationBehaviour? behaviour = null, ButtonPaginationBehavior? deletion = null)

Parameters

channel DiscordChannel

Target channel.

user DiscordUser

The user that will be able to control the pages.

pages IEnumerable<Page>

A collection of Page to display.

buttons PaginationButtons

Pagination buttons (leave null to default to ones on configuration).

timeoutOverride TimeSpan?

Override timeout period.

behaviour PaginationBehaviour?

Pagination behaviour.

deletion ButtonPaginationBehavior?

Deletion behaviour.

Returns

Task

Exceptions

InvalidOperationException

Thrown if interactivity is not enabled for the client associated with the channel.

SendPaginatedMessageAsync(DiscordChannel, DiscordUser, IEnumerable<Page>, TimeSpan?, PaginationBehaviour?, ButtonPaginationBehavior?)

Sends the paginated message async.

public static Task SendPaginatedMessageAsync(this DiscordChannel channel, DiscordUser user, IEnumerable<Page> pages, TimeSpan? timeoutOverride, PaginationBehaviour? behaviour = null, ButtonPaginationBehavior? deletion = null)

Parameters

channel DiscordChannel

The channel.

user DiscordUser

The user.

pages IEnumerable<Page>

The pages.

timeoutOverride TimeSpan?

Override timeout period.

behaviour PaginationBehaviour?

The behaviour.

deletion ButtonPaginationBehavior?

The deletion.

Returns

Task

A Task.