Search Results for

    Show / Hide Table of Contents

    Class Command

    Represents a command.

    Inheritance
    System.Object
    Command
    CommandGroup
    Namespace: DisCatSharp.CommandsNext
    Assembly: DisCatSharp.CommandsNext.dll
    Syntax
    public class Command

    Properties

    | Improve this Doc View Source

    Aliases

    Gets this command's aliases.

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

    CustomAttributes

    Gets the custom attributes defined on this command.

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

    Description

    Gets this command's description.

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

    ExecutionChecks

    Gets a collection of pre-execution checks for this command.

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

    IsHidden

    Gets whether this command is hidden.

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

    Module

    Gets the module in which this command is defined.

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

    Name

    Gets this command's name.

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

    Overloads

    Gets a collection of this command's overloads.

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

    Parent

    Gets this command's parent module, if any.

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

    QualifiedName

    Gets this command's qualified name (i.e. one that includes all module names).

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

    Methods

    | Improve this Doc View Source

    Equals(Object)

    Checks whether this command equals another object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    Object to compare to.

    Returns
    Type Description
    System.Boolean

    Whether this command is equal to another object.

    Overrides
    System.Object.Equals(System.Object)
    | Improve this Doc View Source

    ExecuteAsync(CommandContext)

    Executes this command with specified context.

    Declaration
    public virtual async Task<CommandResult> ExecuteAsync(CommandContext ctx)
    Parameters
    Type Name Description
    CommandContext ctx

    Context to execute the command in.

    Returns
    Type Description
    System.Threading.Tasks.Task<CommandResult>

    Command's execution results.

    | Improve this Doc View Source

    GetHashCode()

    Gets this command's hash code.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    This command's hash code.

    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    RunChecksAsync(CommandContext, Boolean)

    Runs pre-execution checks for this command and returns any that fail for given context.

    Declaration
    public async Task<IEnumerable<CheckBaseAttribute>> RunChecksAsync(CommandContext ctx, bool help)
    Parameters
    Type Name Description
    CommandContext ctx

    Context in which the command is executed.

    System.Boolean help

    Whether this check is being executed from help or not. This can be used to probe whether command can be run without setting off certain fail conditions (such as cooldowns).

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<CheckBaseAttribute>>

    Pre-execution checks that fail for given context.

    | Improve this Doc View Source

    ToString()

    Returns a string representation of this command.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    String representation of this command.

    Overrides
    System.Object.ToString()

    Operators

    | Improve this Doc View Source

    Equality(Command, Command)

    Checks whether this command is equal to another one.

    Declaration
    public static bool operator ==(Command cmd1, Command cmd2)
    Parameters
    Type Name Description
    Command cmd1

    Command to compare to.

    Command cmd2

    Command to compare.

    Returns
    Type Description
    System.Boolean

    Whether the two commands are equal.

    | Improve this Doc View Source

    Inequality(Command, Command)

    Checks whether this command is not equal to another one.

    Declaration
    public static bool operator !=(Command cmd1, Command cmd2)
    Parameters
    Type Name Description
    Command cmd1

    Command to compare to.

    Command cmd2

    Command to compare.

    Returns
    Type Description
    System.Boolean

    Whether the two commands are not equal.

    Extension Methods

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