Class CommandInfo<TParameter>
Inheritance
CommandInfo<TParameter>
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
|
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
|
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
|
Improve this Doc
View Source
MethodName
Gets the name of the command handler method.
Declaration
public string MethodName { get; }
Property Value
|
Improve this Doc
View Source
Module
Gets the module that the method belongs to.
Declaration
public ModuleInfo Module { get; }
Property Value
|
Improve this Doc
View Source
Name
Gets the name of the command.
Declaration
public string Name { get; }
Property Value
|
Improve this Doc
View Source
Parameters
Gets a collection of the parameters of this command.
Declaration
public abstract IReadOnlyList<TParameter> Parameters { get; }
Property Value
Type |
Description |
IReadOnlyList<TParameter> |
|
|
Improve this Doc
View Source
Preconditions
Gets a collection of the preconditions of this command.
Declaration
public IReadOnlyCollection<PreconditionAttribute> Preconditions { get; }
Property Value
|
Improve this Doc
View Source
RunMode
Get the run mode this command gets executed with.
Declaration
public RunMode RunMode { get; }
Property Value
|
Improve this Doc
View Source
SupportsWildCards
Gets whether this command supports wild card patterns.
Declaration
public abstract bool SupportsWildCards { get; }
Property Value
|
Improve this Doc
View Source
TreatNameAsRegex
Declaration
public bool TreatNameAsRegex { get; }
Property Value
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
Returns
|
Improve this Doc
View Source
ExecuteAsync(IInteractionContext, IServiceProvider)
Executes the command with the provided context.
Declaration
public virtual async 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
Returns
|
Improve this Doc
View Source
InvokeEventAndReturn<T>(IInteractionContext, T)
Declaration
protected async Task<T> InvokeEventAndReturn<T>(IInteractionContext context, T result)
where T : IResult
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
InvokeModuleEvent(IInteractionContext, IResult)
Declaration
protected abstract Task InvokeModuleEvent(IInteractionContext context, IResult result)
Parameters
Returns
|
Improve this Doc
View Source
ParseArgumentsAsync(IInteractionContext, IServiceProvider)
Declaration
protected abstract Task<IResult> ParseArgumentsAsync(IInteractionContext context, IServiceProvider services)
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
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
Implements