Class IDiscordInteractionExtentions
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
public static class IDiscordInteractionExtentions
- Inheritance
-
IDiscordInteractionExtentions
- Inherited Members
Methods
RespondWithModalAsync<T>(IDiscordInteraction, string, InteractionService, RequestOptions, Action<ModalBuilder>)
Respond to an interaction with a IModal.
public static Task RespondWithModalAsync<T>(this IDiscordInteraction interaction, string customId, InteractionService interactionService, RequestOptions options = null, Action<ModalBuilder> modifyModal = null) where T : class, IModal
Parameters
interactionIDiscordInteractionThe interaction to respond to.
customIdstringThe custom id of the modal.
interactionServiceInteractionServiceInteraction service instance that should be used to build ModalInfos.
optionsRequestOptionsThe request options for this async request.
modifyModalAction<ModalBuilder>Delegate that can be used to modify the modal.
Returns
- Task
A task that represents the asynchronous operation of responding to the interaction.
Type Parameters
TType of the IModal implementation.
Remarks
This method overload uses the interactionService parameter to create a new ModalInfo
if there isn't a built one already in cache.
RespondWithModalAsync<T>(IDiscordInteraction, string, RequestOptions, Action<ModalBuilder>)
Respond to an interaction with a IModal.
public static Task RespondWithModalAsync<T>(this IDiscordInteraction interaction, string customId, RequestOptions options = null, Action<ModalBuilder> modifyModal = null) where T : class, IModal
Parameters
interactionIDiscordInteractionThe interaction to respond to.
customIdstringThe custom id of the modal.
optionsRequestOptionsThe request options for this async request.
modifyModalAction<ModalBuilder>Delegate that can be used to modify the modal.
Returns
- Task
A task that represents the asynchronous operation of responding to the interaction.
Type Parameters
TType of the IModal implementation.
RespondWithModalAsync<T>(IDiscordInteraction, string, T, RequestOptions, Action<ModalBuilder>)
Respond to an interaction with an IModal and fills the value fields of the modal using the property values of the provided instance.
public static Task RespondWithModalAsync<T>(this IDiscordInteraction interaction, string customId, T modal, RequestOptions options = null, Action<ModalBuilder> modifyModal = null) where T : class, IModal
Parameters
interactionIDiscordInteractionThe interaction to respond to.
customIdstringThe custom id of the modal.
modalTThe IModal instance to get field values from.
optionsRequestOptionsThe request options for this async request.
modifyModalAction<ModalBuilder>Delegate that can be used to modify the modal.
Returns
- Task
A task that represents the asynchronous operation of responding to the interaction.
Type Parameters
TType of the IModal implementation.
ToModalAsync<T>(IDiscordInteraction, string, ModalInfo, T, RequestOptions, Action<ModalBuilder>)
public static Task<Modal> ToModalAsync<T>(this IDiscordInteraction interaction, string customId, ModalInfo modalInfo, T modalInstance = null, RequestOptions options = null, Action<ModalBuilder> modifyModal = null) where T : class, IModal
Parameters
interactionIDiscordInteractioncustomIdstringmodalInfoModalInfomodalInstanceToptionsRequestOptionsmodifyModalAction<ModalBuilder>
Returns
Type Parameters
T