Search Results for

    Show / Hide Table of Contents

    Class CommandInfo<TParameter>

    The base information class for InteractionService commands.

    Inheritance
    Object
    CommandInfo<TParameter>
    AutocompleteCommandInfo
    ComponentCommandInfo
    ContextCommandInfo
    ModalCommandInfo
    SlashCommandInfo
    Implements
    ICommandInfo
    Namespace: Discord.Interactions
    Assembly: Discord.Net.Interactions.dll
    Syntax
    public abstract class CommandInfo<TParameter> : object, ICommandInfo where TParameter : class, IParameterInfo
    Type Parameters
    Name Description
    TParameter

    The type of IParameterInfo that is used by this command type.

    Properties

    | Improve this Doc View Source

    Attributes

    Gets a collection of the attributes of this command.

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

    CommandService

    Gets the the underlying command service.

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

    IgnoreGroupNames

    Gets true if this command will be registered and executed as a standalone command, unaffected by the GroupAttributes of of the commands parents.

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

    IsTopLevelCommand

    Gets true if this command is a top level command and none of its parents have a GroupAttribute.

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

    MethodName

    Gets the name of the command handler method.

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

    Module

    Gets the module that the method belongs to.

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

    Name

    Gets the name of the command.

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

    Parameters

    Gets a collection of the parameters of this command.

    Declaration
    public abstract IReadOnlyCollection<TParameter> Parameters { get; }
    Property Value
    Type Description
    IReadOnlyCollection<TParameter>
    | Improve this Doc View Source

    Preconditions

    Gets a collection of the preconditions of this command.

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

    RunMode

    Get the run mode this command gets executed with.

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

    SupportsWildCards

    Gets wheter this command supports wild card patterns.

    Declaration
    public abstract bool SupportsWildCards { get; }
    Property Value
    Type Description
    Boolean

    Methods

    | Improve this Doc View Source

    CheckPreconditionsAsync(IInteractionContext, IServiceProvider)

    Check if an execution context meets the command precondition requirements.

    Declaration
    public async Task<PreconditionResult> CheckPreconditionsAsync(IInteractionContext context, IServiceProvider services)
    Parameters
    Type Name Description
    IInteractionContext context
    IServiceProvider services
    Returns
    Type Description
    Task<PreconditionResult>
    | Improve this Doc View Source

    ExecuteAsync(IInteractionContext, IServiceProvider)

    Executes the command with the provided context.

    Declaration
    public abstract Task<IResult> ExecuteAsync(IInteractionContext context, IServiceProvider services)
    Parameters
    Type Name Description
    IInteractionContext context

    The execution context.

    IServiceProvider services

    Dependencies that will be used to create the module instance.

    Returns
    Type Description
    Task<IResult>

    A task representing the execution process. The task result contains the execution result.

    | Improve this Doc View Source

    GetLogString(IInteractionContext)

    Declaration
    protected abstract string GetLogString(IInteractionContext context)
    Parameters
    Type Name Description
    IInteractionContext context
    Returns
    Type Description
    String
    | Improve this Doc View Source

    InvokeEventAndReturn(IInteractionContext, IResult)

    Declaration
    protected async ValueTask<IResult> InvokeEventAndReturn(IInteractionContext context, IResult result)
    Parameters
    Type Name Description
    IInteractionContext context
    IResult result
    Returns
    Type Description
    ValueTask<IResult>
    | Improve this Doc View Source

    InvokeModuleEvent(IInteractionContext, IResult)

    Declaration
    protected abstract Task InvokeModuleEvent(IInteractionContext context, IResult result)
    Parameters
    Type Name Description
    IInteractionContext context
    IResult result
    Returns
    Type Description
    Task
    | Improve this Doc View Source

    RunAsync(IInteractionContext, Object[], IServiceProvider)

    Declaration
    protected async Task<IResult> RunAsync(IInteractionContext context, object[] args, IServiceProvider services)
    Parameters
    Type Name Description
    IInteractionContext context
    Object[] args
    IServiceProvider services
    Returns
    Type Description
    Task<IResult>
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICommandInfo.Parameters

    Gets a collection of the parameters of this command.

    Declaration
    IReadOnlyCollection<IParameterInfo> ICommandInfo.Parameters { get; }
    Returns
    Type Description
    IReadOnlyCollection<IParameterInfo>

    Implements

    ICommandInfo

    Theme

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