Search Results for

    Show / Hide Table of Contents

    Class CommandParameterInfo

    Represents the base parameter info class for InteractionService commands.

    Inheritance
    Object
    CommandParameterInfo
    ComponentCommandParameterInfo
    ModalCommandParameterInfo
    SlashCommandParameterInfo
    Implements
    IParameterInfo
    Namespace: Discord.Interactions
    Assembly: Discord.Net.Interactions.dll
    Syntax
    public class CommandParameterInfo : object, IParameterInfo

    Properties

    | Improve this Doc View Source

    Attributes

    Gets a list of the attributes this parameter has.

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

    Command

    Gets the command that this parameter belongs to.

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

    DefaultValue

    Gets the default value of this parameter if the parameter is optional.

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

    IsParameterArray

    Gets whether this parameter is marked with a langword_csharp_params keyword.

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

    IsRequired

    Gets whether this parameter is required.

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

    Name

    Gets the name of this parameter.

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

    ParameterType

    Gets the type of this parameter.

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

    Preconditions

    Gets a list of the preconditions this parameter has.

    Declaration
    public IReadOnlyCollection<ParameterPreconditionAttribute> Preconditions { get; }
    Property Value
    Type Description
    IReadOnlyCollection<ParameterPreconditionAttribute>

    Methods

    | Improve this Doc View Source

    CheckPreconditionsAsync(IInteractionContext, Object, IServiceProvider)

    Check if an execution context meets the parameter precondition requirements.

    Declaration
    public async Task<PreconditionResult> CheckPreconditionsAsync(IInteractionContext context, object value, IServiceProvider services)
    Parameters
    Type Name Description
    IInteractionContext context
    Object value
    IServiceProvider services
    Returns
    Type Description
    Task<PreconditionResult>

    Implements

    IParameterInfo

    Theme

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