Table of Contents
API reference

Method CreatePaginatedModalResponseAsync

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

CreatePaginatedModalResponseAsync(DiscordInteraction, IReadOnlyList<ModalPage>, TimeSpan?)

Sends multiple modals to the user with a prompt to open the next one.

After the last modal, this method automatically responds with the thinking state. Use EditOriginalResponseAsync(DiscordWebhookBuilder, ModifyMode, CancellationToken) to interact with the response.

public static Task<PaginatedModalResponse> CreatePaginatedModalResponseAsync(this DiscordInteraction interaction, IReadOnlyList<ModalPage> modals, TimeSpan? timeoutOverride = null)

Parameters

interaction DiscordInteraction

The interaction to create a response to.

modals IReadOnlyList<ModalPage>

The modal pages.

timeoutOverride TimeSpan?

A custom timeout. (Default: 15 minutes)

Returns

Task<PaginatedModalResponse>

A read-only dictionary with the customid of the components as the key.

Exceptions

ArgumentException

Is thrown when no modals are defined.

InvalidOperationException

Is thrown when interactivity is not enabled for the client/shard.