Table of Contents

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

IReadOnlyCollection<InputComponentInfo>

TextComponents

Gets a collection of the text components of this modal.

public IReadOnlyCollection<TextInputComponentInfo> TextComponents { get; }

Property Value

IReadOnlyCollection<TextInputComponentInfo>

Title

Gets the title of this modal.

public string Title { get; }

Property Value

string

Type

Gets the IModal implementation used to initialize this object.

public Type Type { get; }

Property Value

Type

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

modalInteraction IModalInteraction

IModalInteraction that will be injected into the modal.

throwOnMissingField bool

Returns

IModal

A IModal filled with the provided components.

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

context IInteractionContext

Context of the IModalInteraction that will be injected into the modal.

services IServiceProvider

Services to be passed onto the ComponentTypeConverters of the modal fields.

throwOnMissingField bool

Whether 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.