Class ModalInfo
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Represents the info class of an IModal form.
public class ModalInfo
- Inheritance
-
ModalInfo
- Inherited Members
Properties
Components
Gets a collection of the components of this modal.
public IReadOnlyCollection<InputComponentInfo> Components { get; }
Property Value
TextComponents
Gets a collection of the text components of this modal.
public IReadOnlyCollection<TextInputComponentInfo> TextComponents { get; }
Property Value
Title
Gets the title of this modal.
public string Title { get; }
Property Value
Type
Gets the IModal implementation used to initialize this object.
public Type Type { get; }
Property Value
Methods
CreateModal(IModalInteraction, bool)
Creates an IModal and fills it with provided message components.
[Obsolete("This method is no longer supported with the introduction of Component TypeConverters, please use the CreateModalAsync method.")]
public IModal CreateModal(IModalInteraction modalInteraction, bool throwOnMissingField = false)
Parameters
modalInteractionIModalInteractionIModalInteraction that will be injected into the modal.
throwOnMissingFieldbool
Returns
CreateModalAsync(IInteractionContext, IServiceProvider, bool)
Creates an IModal and fills it with provided message components.
public Task<IResult> CreateModalAsync(IInteractionContext context, IServiceProvider services = null, bool throwOnMissingField = false)
Parameters
contextIInteractionContextContext of the IModalInteraction that will be injected into the modal.
servicesIServiceProviderServices to be passed onto the ComponentTypeConverters of the modal fields.
throwOnMissingFieldboolWhether or not this method should exit on encountering a missing modal field.
Returns
- Task<IResult>
A TypeConverterResult if a type conversion has failed, else a ParseResult.