Class ModalInfo
Represents the info class of an IModal form.
Namespace: Discord.Interactions
Assembly: Discord.Net.Interactions.dll
Syntax
public class ModalInfo : object
Properties
| Improve this Doc View SourceComponents
Gets a collection of the components of this modal.
Declaration
public IReadOnlyCollection<InputComponentInfo> Components { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<InputComponentInfo> |
TextComponents
Gets a collection of the text components of this modal.
Declaration
public IReadOnlyCollection<TextInputComponentInfo> TextComponents { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<TextInputComponentInfo> |
Title
Gets the title of this modal.
Declaration
public string Title { get; }
Property Value
Type | Description |
---|---|
String |
Type
Gets the IModal implementation used to initialize this object.
Declaration
public Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
| Improve this Doc View SourceCreateModal(IModalInteraction, Boolean)
Creates an IModal and fills it with provided message components.
Declaration
public IModal CreateModal(IModalInteraction modalInteraction, bool throwOnMissingField = false)
Parameters
Type | Name | Description |
---|---|---|
IModalInteraction | modalInteraction | IModalInteraction that will be injected into the modal. |
Boolean | throwOnMissingField |
Returns
Type | Description |
---|---|
IModal | A IModal filled with the provided components. |
CreateModalAsync(IInteractionContext, IServiceProvider, Boolean)
Creates an IModal and fills it with provided message components.
Declaration
public async Task<IResult> CreateModalAsync(IInteractionContext context, IServiceProvider services = null, bool throwOnMissingField = false)
Parameters
Type | Name | Description |
---|---|---|
IInteractionContext | context | Context of the IModalInteraction that will be injected into the modal. |
IServiceProvider | services | Services to be passed onto the ComponentTypeConverters of the modal fields. |
Boolean | throwOnMissingField | Whether or not this method should exit on encountering a missing modal field. |
Returns
Type | Description |
---|---|
Task<IResult> | A TypeConverterResult if a type conversion has failed, else a ParseResult. |