Table of Contents

Class RestExtensions

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

Methods

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

Respond to an interaction with a IModal.

public static string RespondWithModal<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

string

Serialized payload to be used to create a HTTP response.

Type Parameters

T

Type of the IModal implementation.

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

Respond to an interaction with an IModal.

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

Parameters

interaction RestInteraction

The interaction to respond to.

customId string
modal 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

string

Serialized payload to be used to create a HTTP response.

Type Parameters

T

Type of the IModal implementation.