Search Results for

    Show / Hide Table of Contents

    Class ModuleBuilder

    Represents a builder for creating ModuleInfo.

    Inheritance
    Object
    ModuleBuilder
    Namespace: Discord.Interactions.Builders
    Assembly: Discord.Net.Interactions.dll
    Syntax
    public class ModuleBuilder : object

    Constructors

    | Improve this Doc View Source

    ModuleBuilder(InteractionService, String, ModuleBuilder)

    Initializes a new ModuleBuilder.

    Declaration
    public ModuleBuilder(InteractionService interactionService, string name, ModuleBuilder parent = null)
    Parameters
    Type Name Description
    InteractionService interactionService

    The underlying Interaction Service.

    String name

    Name of this module.

    ModuleBuilder parent

    Parent module of this sub-module.

    Properties

    | Improve this Doc View Source

    Attributes

    Gets a collection of the attributes of this module.

    Declaration
    public IReadOnlyList<Attribute> Attributes { get; }
    Property Value
    Type Description
    IReadOnlyList<Attribute>
    | Improve this Doc View Source

    AutocompleteCommands

    Gets a collection of the Autocomplete Commands of this module.

    Declaration
    public IReadOnlyList<AutocompleteCommandBuilder> AutocompleteCommands { get; }
    Property Value
    Type Description
    IReadOnlyList<AutocompleteCommandBuilder>
    | Improve this Doc View Source

    ComponentCommands

    Gets a collection of the Component Commands of this module.

    Declaration
    public IReadOnlyList<ComponentCommandBuilder> ComponentCommands { get; }
    Property Value
    Type Description
    IReadOnlyList<ComponentCommandBuilder>
    | Improve this Doc View Source

    ContextCommands

    Gets a collection of the Context Commands of this module.

    Declaration
    public IReadOnlyList<ContextCommandBuilder> ContextCommands { get; }
    Property Value
    Type Description
    IReadOnlyList<ContextCommandBuilder>
    | Improve this Doc View Source

    DefaultMemberPermissions

    Gets the default permissions needed for executing this command.

    Declaration
    public GuildPermission? DefaultMemberPermissions { get; set; }
    Property Value
    Type Description
    Nullable<GuildPermission>
    | Improve this Doc View Source

    DefaultPermission

    Gets and sets the default permission of this module.

    Declaration
    public bool DefaultPermission { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Description

    Gets and sets the description of this module.

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

    DontAutoRegister

    Gets and sets whether this has a DontAutoRegisterAttribute.

    Declaration
    public bool DontAutoRegister { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    InteractionService

    Gets the underlying Interaction Service.

    Declaration
    public InteractionService InteractionService { get; }
    Property Value
    Type Description
    InteractionService
    | Improve this Doc View Source

    IsEnabledInDm

    Gets whether this command can be used in DMs.

    Declaration
    public bool IsEnabledInDm { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsNsfw

    Gets whether this command is age restricted.

    Declaration
    public bool IsNsfw { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    IsSlashGroup

    Gets whether this has a GroupAttribute.

    Declaration
    public bool IsSlashGroup { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    ModalCommands

    Gets a collection of the Modal Commands of this module.

    Declaration
    public IReadOnlyList<ModalCommandBuilder> ModalCommands { get; }
    Property Value
    Type Description
    IReadOnlyList<ModalCommandBuilder>
    | Improve this Doc View Source

    Name

    Gets the name of this module.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Parent

    Gets the parent module if this module is a sub-module.

    Declaration
    public ModuleBuilder Parent { get; }
    Property Value
    Type Description
    ModuleBuilder
    | Improve this Doc View Source

    Preconditions

    Gets a collection of the preconditions of this module.

    Declaration
    public IReadOnlyCollection<PreconditionAttribute> Preconditions { get; }
    Property Value
    Type Description
    IReadOnlyCollection<PreconditionAttribute>
    | Improve this Doc View Source

    SlashCommands

    Gets a collection of the Slash Commands of this module.

    Declaration
    public IReadOnlyList<SlashCommandBuilder> SlashCommands { get; }
    Property Value
    Type Description
    IReadOnlyList<SlashCommandBuilder>
    | Improve this Doc View Source

    SlashGroupName

    Gets and sets the group name of this module.

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

    SubModules

    Gets a collection of the sub-modules of this module.

    Declaration
    public IReadOnlyList<ModuleBuilder> SubModules { get; }
    Property Value
    Type Description
    IReadOnlyList<ModuleBuilder>

    Methods

    | Improve this Doc View Source

    AddAttributes(Attribute[])

    Adds attributes to Attributes.

    Declaration
    public ModuleBuilder AddAttributes(params Attribute[] attributes)
    Parameters
    Type Name Description
    Attribute[] attributes

    New attributes to be added to Attributes.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddAutocompleteCommand(Action<AutocompleteCommandBuilder>)

    Adds autocomplete command builder to AutocompleteCommands.

    Declaration
    public ModuleBuilder AddAutocompleteCommand(Action<AutocompleteCommandBuilder> configure)
    Parameters
    Type Name Description
    Action<AutocompleteCommandBuilder> configure

    AutocompleteCommands factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddComponentCommand(Action<ComponentCommandBuilder>)

    Adds component command builder to ComponentCommands.

    Declaration
    public ModuleBuilder AddComponentCommand(Action<ComponentCommandBuilder> configure)
    Parameters
    Type Name Description
    Action<ComponentCommandBuilder> configure

    ComponentCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddComponentCommand(String, ExecuteCallback, Action<ComponentCommandBuilder>)

    Adds component command builder to ComponentCommands.

    Declaration
    public ModuleBuilder AddComponentCommand(string name, ExecuteCallback callback, Action<ComponentCommandBuilder> configure)
    Parameters
    Type Name Description
    String name

    Name of the command.

    ExecuteCallback callback

    Command callback to be executed.

    Action<ComponentCommandBuilder> configure

    ComponentCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddContextCommand(Action<ContextCommandBuilder>)

    Adds context command builder to ContextCommands.

    Declaration
    public ModuleBuilder AddContextCommand(Action<ContextCommandBuilder> configure)
    Parameters
    Type Name Description
    Action<ContextCommandBuilder> configure

    ContextCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddContextCommand(String, ExecuteCallback, Action<ContextCommandBuilder>)

    Adds context command builder to ContextCommands.

    Declaration
    public ModuleBuilder AddContextCommand(string name, ExecuteCallback callback, Action<ContextCommandBuilder> configure)
    Parameters
    Type Name Description
    String name

    Name of the command.

    ExecuteCallback callback

    Command callback to be executed.

    Action<ContextCommandBuilder> configure

    ContextCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddModalCommand(Action<ModalCommandBuilder>)

    Adds a modal command builder to ModalCommands.

    Declaration
    public ModuleBuilder AddModalCommand(Action<ModalCommandBuilder> configure)
    Parameters
    Type Name Description
    Action<ModalCommandBuilder> configure

    ModalCommands factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddModalCommand(String, ExecuteCallback, Action<ModalCommandBuilder>)

    Adds a modal command builder to ModalCommands.

    Declaration
    public ModuleBuilder AddModalCommand(string name, ExecuteCallback callback, Action<ModalCommandBuilder> configure)
    Parameters
    Type Name Description
    String name

    Name of the command.

    ExecuteCallback callback

    Command callback to be executed.

    Action<ModalCommandBuilder> configure

    ModalCommands factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddModule(Action<ModuleBuilder>)

    Adds sub-module builder to SubModules.

    Declaration
    public ModuleBuilder AddModule(Action<ModuleBuilder> configure)
    Parameters
    Type Name Description
    Action<ModuleBuilder> configure

    ModuleBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddPreconditions(PreconditionAttribute[])

    Adds preconditions to Preconditions.

    Declaration
    public ModuleBuilder AddPreconditions(params PreconditionAttribute[] preconditions)
    Parameters
    Type Name Description
    PreconditionAttribute[] preconditions

    New preconditions to be added to Preconditions.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddSlashCommand(Action<SlashCommandBuilder>)

    Adds slash command builder to SlashCommands.

    Declaration
    public ModuleBuilder AddSlashCommand(Action<SlashCommandBuilder> configure)
    Parameters
    Type Name Description
    Action<SlashCommandBuilder> configure

    SlashCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddSlashCommand(String, ExecuteCallback, Action<AutocompleteCommandBuilder>)

    Adds autocomplete command builder to AutocompleteCommands.

    Declaration
    public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action<AutocompleteCommandBuilder> configure)
    Parameters
    Type Name Description
    String name

    Name of the command.

    ExecuteCallback callback

    Command callback to be executed.

    Action<AutocompleteCommandBuilder> configure

    AutocompleteCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    AddSlashCommand(String, ExecuteCallback, Action<SlashCommandBuilder>)

    Adds slash command builder to SlashCommands.

    Declaration
    public ModuleBuilder AddSlashCommand(string name, ExecuteCallback callback, Action<SlashCommandBuilder> configure)
    Parameters
    Type Name Description
    String name

    Name of the command.

    ExecuteCallback callback

    Command callback to be executed.

    Action<SlashCommandBuilder> configure

    SlashCommandBuilder factory.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    SetEnabledInDm(Boolean)

    Sets IsEnabledInDm.

    Declaration
    public ModuleBuilder SetEnabledInDm(bool isEnabled)
    Parameters
    Type Name Description
    Boolean isEnabled

    New value of the IsEnabledInDm.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    SetNsfw(Boolean)

    Sets IsNsfw.

    Declaration
    public ModuleBuilder SetNsfw(bool isNsfw)
    Parameters
    Type Name Description
    Boolean isNsfw

    New value of the IsNsfw.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    WithDefaultMemberPermissions(GuildPermission)

    Sets DefaultMemberPermissions.

    Declaration
    public ModuleBuilder WithDefaultMemberPermissions(GuildPermission permissions)
    Parameters
    Type Name Description
    GuildPermission permissions

    New value of the DefaultMemberPermissions.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    WithDefaultPermission(Boolean)

    Sets DefaultPermission.

    Declaration
    public ModuleBuilder WithDefaultPermission(bool permission)
    Parameters
    Type Name Description
    Boolean permission

    New value of the DefaultPermission.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    WithDescription(String)

    Sets Description.

    Declaration
    public ModuleBuilder WithDescription(string description)
    Parameters
    Type Name Description
    String description

    New value of the Description.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    | Improve this Doc View Source

    WithGroupName(String)

    Sets SlashGroupName.

    Declaration
    public ModuleBuilder WithGroupName(string name)
    Parameters
    Type Name Description
    String name

    New value of the SlashGroupName.

    Returns
    Type Description
    ModuleBuilder

    The builder instance.

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2023 3.12.0