Search Results for

    Show / Hide Table of Contents

    Class ActionRowComponentBuilder

    A builder class used to build action row components.

    Inheritance
    System.Object
    ActionRowComponentBuilder
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Color_Chan.Discord.Commands.MessageBuilders
    Assembly: Color-Chan.Discord.Commands.dll
    Syntax
    public class ActionRowComponentBuilder

    Methods

    | Improve this Doc View Source

    Build()

    Builds the action row IDiscordComponent.

    Declaration
    public IDiscordComponent Build()
    Returns
    Type Description
    IDiscordComponent

    The build action row IDiscordComponent.

    | Improve this Doc View Source

    WithButton(IDiscordEmoji, DiscordButtonStyle, String, String, Boolean)

    Adds a button to the action row.

    Declaration
    public ActionRowComponentBuilder WithButton(IDiscordEmoji emoji, DiscordButtonStyle style, string customId = null, string url = null, bool disabled = false)
    Parameters
    Type Name Description
    IDiscordEmoji emoji

    The emoji the button will use.

    DiscordButtonStyle style

    The style the button will use.

    System.String customId

    The custom id. Required if url is not set.

    System.String url

    The URL the button will open. Required if customId is not set.

    System.Boolean disabled

    Whether or not the button is disabled.

    Returns
    Type Description
    ActionRowComponentBuilder

    The ActionRowComponentBuilder with the added button.

    Remarks

    Only one of url or customId can be set!

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When the ActionRow already has 5 buttons.

    MissingButtonPropertiesException

    When url and customId are both null.

    System.ArgumentException

    When url customId are both set.

    InvalidActionRowException

    When the Color_Chan.Discord.Commands.MessageBuilders.ActionRowComponentBuilder._childComponents contains a select menu component.

    | Improve this Doc View Source

    WithButton(String, DiscordButtonStyle, String, String, IDiscordEmoji, Boolean)

    Adds a button to the action row.

    Declaration
    public ActionRowComponentBuilder WithButton(string label, DiscordButtonStyle style, string customId = null, string url = null, IDiscordEmoji emoji = null, bool disabled = false)
    Parameters
    Type Name Description
    System.String label

    The label of the button.

    DiscordButtonStyle style

    The style the button will use.

    System.String customId

    The custom id. Required if url is not set.

    System.String url

    The URL the button will open. Required if customId is not set.

    IDiscordEmoji emoji

    The emoji the button will use.

    System.Boolean disabled

    Whether or not the button is disabled.

    Returns
    Type Description
    ActionRowComponentBuilder

    The ActionRowComponentBuilder with the added button.

    Remarks

    Only one of url or customId can be set!

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When the ActionRow already has 5 buttons.

    System.ArgumentOutOfRangeException

    When label contains more then 80 characters.

    MissingButtonPropertiesException

    When url and customId are both null.

    System.ArgumentException

    When url customId are both set.

    System.ArgumentNullException

    When label is null.

    InvalidActionRowException

    When the Color_Chan.Discord.Commands.MessageBuilders.ActionRowComponentBuilder._childComponents contains a select menu component.

    | Improve this Doc View Source

    WithSelectMenu(String, String, Nullable<Int32>, Nullable<Int32>, Nullable<Boolean>)

    Adds a select menu to the action row.

    Declaration
    public ActionRowComponentBuilder WithSelectMenu(string customId, string placeholder = null, int? minValues = null, int? maxValues = null, bool? disabled = null)
    Parameters
    Type Name Description
    System.String customId

    The custom id of the select menu.

    System.String placeholder

    Custom placeholder text if nothing is selected, max 100 characters.

    System.Nullable<System.Int32> minValues

    The minimum number of items that must be chosen; default 1, min 0, max 25.

    System.Nullable<System.Int32> maxValues

    The maximum number of items that can be chosen; default 1, max 25.

    System.Nullable<System.Boolean> disabled

    Disable the select, default false.

    Returns
    Type Description
    ActionRowComponentBuilder

    The ActionRowComponentBuilder with the added select menu.

    Exceptions
    Type Condition
    InvalidActionRowException

    Thrown when the action row has button assigned to it.

    InvalidActionRowException

    Thrown when the action row already has a select menu.

    | Improve this Doc View Source

    WithSelectMenuOption(String, String, String, IDiscordEmoji, Nullable<Boolean>)

    Adds a select menu option to the select menu.

    Declaration
    public ActionRowComponentBuilder WithSelectMenuOption(string label, string value, string description = null, IDiscordEmoji emoji = null, bool? disabled = false)
    Parameters
    Type Name Description
    System.String label

    The user-facing name of the option, max 100 characters.

    System.String value

    The dev-define value of the option, max 100 characters.

    System.String description

    An additional description of the option, max 100 characters.

    IDiscordEmoji emoji

    The emoji containing the id, name, and animated.

    System.Nullable<System.Boolean> disabled

    Will render this option as selected by default.

    Returns
    Type Description
    ActionRowComponentBuilder

    The ActionRowComponentBuilder with the added select menu option.

    Exceptions
    Type Condition
    InvalidActionRowException

    Thrown when the action row has button assigned to it.

    InvalidActionRowException

    Thrown when the action row does not contain a select menu.

    System.NullReferenceException

    Thrown when the SelectOptions is null.

    System.ArgumentOutOfRangeException

    Thrown when the select menu already contains 25 option.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX