Search Results for

    Show / Hide Table of Contents

    Class DiscordInteractionModalBuilder

    Constructs an interaction modal response.

    Inheritance
    System.Object
    DiscordInteractionModalBuilder
    Namespace: DisCatSharp.Entities
    Assembly: DisCatSharp.dll
    Syntax
    public sealed class DiscordInteractionModalBuilder

    Constructors

    | Improve this Doc View Source

    DiscordInteractionModalBuilder(String, String)

    Constructs a new empty interaction modal builder.

    Declaration
    public DiscordInteractionModalBuilder(string title = null, string customId = null)
    Parameters
    Type Name Description
    System.String title
    System.String customId

    Properties

    | Improve this Doc View Source

    CustomId

    Custom id of modal.

    Declaration
    public string CustomId { get; set; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    ModalComponents

    Components to send on this interaction response.

    Declaration
    public IReadOnlyList<DiscordActionRowComponent> ModalComponents { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<DiscordActionRowComponent>
    | Improve this Doc View Source

    Title

    Title of modal.

    Declaration
    public string Title { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    AddModalComponents(DiscordComponent[])

    Appends a collection of components to the builder.

    Declaration
    public DiscordInteractionModalBuilder AddModalComponents(params DiscordComponent[] components)
    Parameters
    Type Name Description
    DiscordComponent[] components

    The components to append. Up to five.

    Returns
    Type Description
    DiscordInteractionModalBuilder

    The current builder to chain calls with.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when passing more than 5 components.

    | Improve this Doc View Source

    AddModalComponents(IEnumerable<DiscordActionRowComponent>)

    Appends several rows of components to the message

    Declaration
    public DiscordInteractionModalBuilder AddModalComponents(IEnumerable<DiscordActionRowComponent> components)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<DiscordActionRowComponent> components

    The rows of components to add, holding up to five each.

    Returns
    Type Description
    DiscordInteractionModalBuilder

    The current builder to chain calls with.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when passing more than 5 components.

    | Improve this Doc View Source

    AddSelectComponent(DiscordSelectComponent)

    Appends a select component to the builder.

    Declaration
    public DiscordInteractionModalBuilder AddSelectComponent(DiscordSelectComponent component)
    Parameters
    Type Name Description
    DiscordSelectComponent component

    The component to append.

    Returns
    Type Description
    DiscordInteractionModalBuilder

    The current builder to chain calls with.

    | Improve this Doc View Source

    AddSelectComponents(DiscordSelectComponent[])

    Appends a collection of select components to the builder. Each call will append to a new row.

    Declaration
    public DiscordInteractionModalBuilder AddSelectComponents(params DiscordSelectComponent[] components)
    Parameters
    Type Name Description
    DiscordSelectComponent[] components

    The components to append. Up to five.

    Returns
    Type Description
    DiscordInteractionModalBuilder

    The current builder to chain calls with.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when passing more than 5 components.

    | Improve this Doc View Source

    AddTextComponent(DiscordTextComponent)

    Appends a text component to the builder.

    Declaration
    public DiscordInteractionModalBuilder AddTextComponent(DiscordTextComponent component)
    Parameters
    Type Name Description
    DiscordTextComponent component

    The component to append.

    Returns
    Type Description
    DiscordInteractionModalBuilder

    The current builder to chain calls with.

    | Improve this Doc View Source

    AddTextComponents(DiscordTextComponent[])

    Appends a collection of text components to the builder. Each call will append to a new row.

    Declaration
    public DiscordInteractionModalBuilder AddTextComponents(params DiscordTextComponent[] components)
    Parameters
    Type Name Description
    DiscordTextComponent[] components

    The components to append. Up to five.

    Returns
    Type Description
    DiscordInteractionModalBuilder

    The current builder to chain calls with.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown when passing more than 5 components.

    | Improve this Doc View Source

    Clear()

    Allows for clearing the Interaction Response Builder so that it can be used again to send a new response.

    Declaration
    public void Clear()
    | Improve this Doc View Source

    ClearComponents()

    Clears all message components on this builder.

    Declaration
    public void ClearComponents()
    | Improve this Doc View Source

    WithCustomId(String)

    Declaration
    public DiscordInteractionModalBuilder WithCustomId(string customId)
    Parameters
    Type Name Description
    System.String customId
    Returns
    Type Description
    DiscordInteractionModalBuilder
    | Improve this Doc View Source

    WithTitle(String)

    Declaration
    public DiscordInteractionModalBuilder WithTitle(string title)
    Parameters
    Type Name Description
    System.String title
    Returns
    Type Description
    DiscordInteractionModalBuilder

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems