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

ChannelSelectComponents

Get a collection of the channel select components of this modal.

public IReadOnlyCollection<ChannelSelectComponentInfo> ChannelSelectComponents { get; }

Property Value

IReadOnlyCollection<ChannelSelectComponentInfo>

Components

Gets a collection of the components of this modal.

public IReadOnlyCollection<ModalComponentInfo> Components { get; }

Property Value

IReadOnlyCollection<ModalComponentInfo>

FileUploadComponents

Get a collection of the file upload components of this modal.

public IReadOnlyCollection<FileUploadComponentInfo> FileUploadComponents { get; }

Property Value

IReadOnlyCollection<FileUploadComponentInfo>

InputComponents

Gets a collection of the input components of this modal.

public IReadOnlyCollection<InputComponentInfo> InputComponents { get; }

Property Value

IReadOnlyCollection<InputComponentInfo>

MentionableSelectComponents

Get a collection of the mentionable select components of this modal.

public IReadOnlyCollection<MentionableSelectComponentInfo> MentionableSelectComponents { get; }

Property Value

IReadOnlyCollection<MentionableSelectComponentInfo>

RoleSelectComponents

Get a collection of the role select components of this modal.

public IReadOnlyCollection<RoleSelectComponentInfo> RoleSelectComponents { get; }

Property Value

IReadOnlyCollection<RoleSelectComponentInfo>

SelectMenuComponents

Get a collection of the select menu components of this modal.

public IReadOnlyCollection<SelectMenuComponentInfo> SelectMenuComponents { get; }

Property Value

IReadOnlyCollection<SelectMenuComponentInfo>

TextDisplayComponents

Gets a collection of the text display components of this modal.

public IReadOnlyCollection<TextDisplayComponentInfo> TextDisplayComponents { get; }

Property Value

IReadOnlyCollection<TextDisplayComponentInfo>

TextInputComponents

Gets a collection of the text components of this modal.

public IReadOnlyCollection<TextInputComponentInfo> TextInputComponents { 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

UserSelectComponents

Get a collection of the user select components of this modal.

public IReadOnlyCollection<UserSelectComponentInfo> UserSelectComponents { get; }

Property Value

IReadOnlyCollection<UserSelectComponentInfo>

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.