Table of Contents

Class RestExtensions

Namespace
Discord.Rest
Assembly
Discord.Net.Interactions.dll
public static class RestExtensions
Inheritance
RestExtensions
Inherited Members

Methods

RespondWithModalAsync<T>(RestInteraction, string, RequestOptions, Action<ModalBuilder>)

Respond to an interaction with a IModal.

public static Task<string> RespondWithModalAsync<T>(this RestInteraction interaction, string customId, RequestOptions options = null, Action<ModalBuilder> modifyModal = null) where T : class, IModal

Parameters

interaction RestInteraction

The interaction to respond to.

customId string
options RequestOptions

The request options for this async request.

modifyModal Action<ModalBuilder>

Returns

Task<string>

Task representing the asynchronous modal creation operation. The task result contains the serialized payload to be used to create a HTTP response.

Type Parameters

T

Type of the IModal implementation.

RespondWithModalAsync<T>(RestInteraction, string, T, RequestOptions, Action<ModalBuilder>)

Respond to an interaction with an IModal.

public static Task<string> RespondWithModalAsync<T>(this RestInteraction interaction, string customId, T modalInstance, RequestOptions options = null, Action<ModalBuilder> modifyModal = null) where T : class, IModal

Parameters

interaction RestInteraction

The interaction to respond to.

customId string
modalInstance T

The IModal instance to get field values from.

options RequestOptions

The request options for this async request.

modifyModal Action<ModalBuilder>

Delegate that can be used to modify the modal.

Returns

Task<string>

Task representing the asynchronous modal creation operation. The task result contains the serialized payload to be used to create a HTTP response.

Type Parameters

T

Type of the IModal implementation.