Class InteractionExtensions
The interaction extensions.
Inheritance
Namespace: DisCatSharp.Interactivity.Extensions
Assembly: DisCatSharp.Interactivity.dll
Syntax
public static class InteractionExtensions
Methods
| Improve this Doc View SourceCreatePaginatedModalResponseAsync(DiscordInteraction, IReadOnlyList<ModalPage>, Nullable<TimeSpan>)
Sends multiple modals to the user with a prompt to open the next one.
Declaration
public static async Task<PaginatedModalResponse> CreatePaginatedModalResponseAsync(this DiscordInteraction interaction, IReadOnlyList<ModalPage> modals, TimeSpan? timeOutOverride = null)
Parameters
Type | Name | Description |
---|---|---|
DiscordInteraction | interaction | The interaction to create a response to. |
System.Collections.Generic.IReadOnlyList<ModalPage> | modals | The modal pages. |
System.Nullable<System.TimeSpan> | timeOutOverride | A custom timeout. (Default: 15 minutes) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<PaginatedModalResponse> | A read-only dictionary with the customid of the components as the key. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Is thrown when no modals are defined. |
System.InvalidOperationException | Is thrown when interactivity is not enabled for the client/shard. |
SendPaginatedResponseAsync(DiscordInteraction, Boolean, DiscordUser, IEnumerable<Page>, PaginationButtons, Nullable<PaginationBehaviour>, Nullable<ButtonPaginationBehavior>, CancellationToken)
Sends a paginated message in response to an interaction.
Pass the interaction directly. Interactivity will ACK it.
Declaration
public static Task SendPaginatedResponseAsync(this DiscordInteraction interaction, bool ephemeral, DiscordUser user, IEnumerable<Page> pages, PaginationButtons buttons = null, PaginationBehaviour? behaviour = null, ButtonPaginationBehavior? deletion = null, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
DiscordInteraction | interaction | The interaction to create a response to. |
System.Boolean | ephemeral | Whether the response should be ephemeral. |
DiscordUser | user | The user to listen for button presses from. |
System.Collections.Generic.IEnumerable<Page> | pages | The pages to paginate. |
PaginationButtons | buttons | Optional: custom buttons |
System.Nullable<PaginationBehaviour> | behaviour | Pagination behaviour. |
System.Nullable<ButtonPaginationBehavior> | deletion | Deletion behaviour |
System.Threading.CancellationToken | token | A custom cancellation token that can be cancelled at any point. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |